Twitter Feeds widget

//USAGE – set the keys and token here and then just include this file into your code. Change the <li> to whatever needed. if(!isset($tweetAuthen) && $tweetAuthen != “awre4rwrwfe”) //random string to prevent this file being run directly {     echo “<li>Unauthorized use of widget</li>!”; } else {         //Files needed for the Twitter authentification    … Continue reading Twitter Feeds widget

Published
Categorised as PHP

PHP include Remote File

In some case it might be needed to include or run a remote file and display the output on the current site. For this to work the below settings needs to be enabled. allow_url_fopen = On allow_url_include = On But in case those two settings cannot be changed or even after changing it doesn’t work… Continue reading PHP include Remote File

Published
Categorised as PHP

Prevent CRON from overlapping

To solve situations where CRON starts another copy before the current one finishes. At the top of the CRON job use: //check if already running $buff = file_get_contents(“cron_stat.txt”); if($buff == 1) { die(); } //set a running flag; file_put_contents(“cron_stat.txt”,”1″); …… …… …… When the CRON will run for the first time “cron_stat.txt” will be blank… Continue reading Prevent CRON from overlapping

PayPal form submit through PHP

PayPal Payments Standard is a quick and easy way to integrate Paypal with any website. Normally the method uses a form to send the various details of the transaction to Paypal server. The below code can simulate the form submission through PHP. With this no form is required. The details of transaction pulled from DB,… Continue reading PayPal form submit through PHP

Published
Categorised as PHP

Distance between two Latitudes and Longitudes – Part 1

This series is about code in various languages that will calculate the distance between two latitudes and longitudes. This article is for the PHP code. Code courtsey : GeoDataSource /*::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::*/ /*:: :*/ /*:: This routine calculates the distance between two :*/ /*:: points (given the latitude/longitude of those points). :*/ /*:: It is being used… Continue reading Distance between two Latitudes and Longitudes – Part 1

Published
Categorised as PHP