Upload Files through AJAX (using Jquery and PHP)

This post demonstrates how to upload files to the server through AJAX. For the javascript  part JQuery has been used. Besides the file upload thing there are few other useful codes here: A generalised mail function. The function is capable of sending mails with attachments also. Ajax call using JQuery. Some server side validation codes.… Continue reading Upload Files through AJAX (using Jquery and PHP)

Published
Categorised as jQuery, PHP

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

Website Load testing

Using Apache JMeter Full article can be found here : http://jmeter.apache.org/usermanual/build-web-test-plan.html Wapt Pro 30 days trial available. 20 users simulation in the trial version. Website : http://www.loadtestingtool.com/download.shtml LoadImpact Website Free online testing. 50 users simulation. Website : http://loadimpact.com/