Wordpress - the background image does not work with home_url ()

I have a number of background images I'm using on a WordPress site which is ready to move to production. I'm changing all the localhost absolute links in my style.css file. I've changed my code for a background image from this: background: url('http:

php replaces all string occurrences with array values

I have a string containing image ID's and an array which has for the keys the old image ID's and for the values new image ID's. I need to search through the content for old ones and replace with the new ones. I've done this <?php $string = 'Lorem ips

Mysqli query with binding parameters using fetch_array

I know how to use fetch_array instead of printf() function when expressing rows from database using mysqli bind function. How can I use $row->mysqli_fetch_array and then use $row[0],$row[1] instead of using the printf() function every time I want to

Get the most common value of the MySQL column in PHP

I have a simple table in phpmyadmin called name with only 1 column id which is look like this id -------- a b a a a a b Now i want to show most used id on my PHP page. Here is my code: $sql_a = mysql_query(SELECT id FROM name WHERE id='a'); $count_a

Loop JSON data and place it in another function in codeigniter

I want to loop the data from json and put the result into another function in controller. function to get the json format public function getApiSuperSpring() { // Initiate curl $service_url="http://obd.id-clouds.net/raja_engine/GPS2.php?CMD=GETVEHICL

redirect to the php page after ajax success in jquery

i am working on search form with autocomplete function. my autocomplete is working fine. i want to send the data to another php page after autocomplete value is set. below is my jquery for autocompleate. function autocomplet() { var min_length = 1; /

How to check Paypal webhook signature in PHP?

I'm not very knowledgeable in SSL and certificates. I used the post "How to use hash_hmac() with "SHA256withRSA" on PHP?" to see if I can get webhooks with PayPal working. The issue I am have is I am getting the following error after c

$ _FILES undefined index error

i check all topics in stack about files and undefined index error but cant find answer anywhere. I have two files: wpis.html <form action="wpis.php" method="POST"> <input type="file" name="file"> <inp

PHP file_put_contents: failure to open stream: protocol error

Saving an image using PHP copy or file_put_contents returns sometimes the following error: failed to open stream: Protocol error. This is the workflow I tried: // A. using file_get_contents and file_put_contents $image = file_get_contents('https://ma

Multiple jquery

I want to give the user an option so he can write IDs of wordpress categories that are going to be shown on an specific page. The wordpress field is going to be named the_field('categories_id') so if he enters there IDs with comma separated like this

Publish in the wrong category

I've a weird problem, some posts appears in categories where they are not in. When I look in my backoffice and filter by categories, some post appears there but they are not checked in. The resultat is that in the front office they appear too. This i

Does the file size slow down the php response?

I currently use a one file design... where all my php code is in one index.php file, I have about 13,000 lines (~1mb) in one file, and it is starting to hang a little on load time... I was thinking it could be the file size, but I had always thought

PHP removes the timestamp from the string

In a PHP script I need to remove the 00:00:00 from "2003-01-28 00:00:00". No matter what numbers are in the 00:00:00 it should be stripped if exists. Is there some sort of formula (regex maybe?) that can detect and remove it? Additionally, the 0

PHP tracking issues

I have a file, functions.php. Within the file is some functions that point at specific locations, like thisone: function returnFolders() { $folders = array_filter(glob("images/*"), 'is_dir'); return $folders; } This function returns the director

NSString analysis as JSON

I have read several forums but am seemingly unable to accomplish this simple task. I have a View in Xcode that points to a PHP script and stores the results as the NSString below: [{"id":"16","name":"Bob","age&

PHP Multiplier array () * integer

My code is: HTML part for POST: <form action='key.php' method='POST'> <input type='number' name='consumervar[]' value='512'/> <input type='number' name='consumervar[]' value='256'/> <input type='number' name='consumervar[]' value='102

Undefined index errors when using the more equal operator

I'm working on another developers old code and there are tons of Notice: Undefined index errors when data is being set using the += operator. Essentially the index is not set yet in the array so the error is generated. Example: $myArray = array(); $m

Get the records named MySQL table.column with PHP

For example: I have the normal column name: SELECT column FROM.... The way i retrieve it in PHP: $var = $row["column"]; What i want to know is how to retrieve column records which are named with column and table: SELECT table.column FROM...It wo

php mysql select as not working

I am trying to query a mysql table using some "likes". But it doesn't work at all. This is my code: $color_base1 = $row[color_base1]; $color_base2 = $row[color_base2]; $result2 = mysql_query("SELECT * FROM item_descr WHERE (color_base1 LIKE

Separate stdclass with PHP

I'm trying to access part of an StdClass that has a property #text. PHP uses '#' for comments so I'm having trouble getting PHP to parse it not as a comment. An example of the StdClass is below stdClass Object ( [artist] => stdClass Object ( [name] =

JQuery Error Uploadify HTTP (HTTP Error: 302)

Uploadify keeps giving me a "HTTP error" and its starting to get pretty annoying. Here is how I invoke uploadify: $(document).ready( function() { $('#upload_image').uploadify({ 'uploader' : '/templates/v2/uploadify/uploadify.swf', 'script' : '/u

How to use Jquery ajax to set $ _SESSION?

I am trying to create a simple log in system that uses ajax but the problem I am having it wont set the $_SESSION. login.js: $('#bt-login').click(function(){ var login = $('#login').serialize(); $.ajax({ type: "POST", url: 'widgets/Login/loginFu