Skip to content

Tag: php

Sending free sms using PHP

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 …

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 …

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…