I am trying to develop a PHP based application to send sms across India to contacts picked from the database. After searching for hours, I found the following working (I tested it) script which makes …
Tag: php
Refer to specific product ID in WordPress / WooCommerce in PHP
I have this script that adds a download button to every product page in WooCommerce but I need to exclude a product page from having the download button. I tried changing the first line to but it is failing, I think I am on the right track but need to reference it correctly (It should only enter the if functi…
Removing successive duplicate occurrences in an array
Is there any way that I can remove the successive duplicates from the array below while only keeping the first one? The array is shown below: What I want is to have an array that contains: Answer You can just do something like: Assuming you’re not manipulating that array in between you can use current()…
How to Load Ajax in WordPress
I’m familiar with using ajax in the ordinary way with jQuery. I’ve played around it for a while, but don’t understand what WordPress needs to get it to work… What I have here is taken from some …
MySQL SSL Remote Connection Error: Unable to get Private Key
I am attempting to write a PHP script (hosted on a VPS with GoDaddy) that connects to a remote MySQL database (hosted on an Amazon EC2 instance) using SSL. I generated some certs (as per http://dev….
Php – Your PHP installation appears to be missing the MySQL extension which is required by WordPress
How do I fix the error below? Your PHP installation appears to be missing the MySQL extension which is required by WordPress. I use my NAS with a telnet connection. I installed FFP 0.7 My php.ini is in: ffp/etc/php.ini and I uncommented everything I thought to be of use. Below is a portion of my php.ini file;…
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ”
Using a form, I was trying to insert data into my database. The initial SQL query had variables for values, but it didn’t work. After trying a few things and using mysqli_error I wasn’t able to find the problem. I then replaced all the variables with strings, still, my data does not insert. I̵…
Search form with PDO
The below code now works but how can I make it so if no results are found it echos a message instead of blank. I think I’ve managed to create a search query for my database. Its only a very basic …
html2canvas save image doesn’t work
I’m rendering a screenshot with html2canvas 0.4.0 and want to save it as image on my webserver. To do so, I’ve written the following function: JavaScript saveJPG.php After the canvas is rendered I can perfectly append it to the HTML body, but saving it on my server result in a corrupted (?) file. …
How to simulate Past-Due status on Subscription
I have setup a PHP script on a cron which contacts Braintree via the API to look up the status of each subscription that we have on file. We then update our local records based on the customer’s subscription status. Because I can manually cancel a subscription from the Braintree control panel, I have be…