PHP 5.4.10 and PHP 5.3.20 released!

December 22nd, 2012 by laeeq | No comments

The regular PHP updates are released for PHP 5.4.10 and PHP 5.3.20. The PHP development team announces the immediate availability of PHP 5.4.10 and PHP 5.3.20. These releases fix about 15 bugs. Please note that the PHP 5.3 series will enter an end of life cycle and receive only critical fixes as of March 2013. All users of PHP are encouraged to upgrade to PHP 5.4.

Read Full Post »

Get all images from a HTML document Using PHP

December 21st, 2012 by laeeq | No comments

Sometimes we have to get the images from an HTML page just like Facebook does when a link is posted. You can easily get images from HTML page using PHP. Below example code will return all images from a HTML document, you just need to get the source content of any HTML page and pass through below PHP function.

Read Full Post »

Sanitize Your Input in PHP

December 14th, 2012 by laeeq | No comments

We cannot always trust user input because it may be malicious. You should always check all global arrays like $_GET, $_POST, $_REQUEST, $_COOKIE, allow only known variables and make sure that they contain the right type of data. Also keep only those variables which your script requires. For example if you have a $_GET['id'] variable in your script which has to be an integer, then check it and make sure it is an integer. So sanitization of user input is important. Here you will learn how to sanitize user inputs.

Read Full Post »

PHP $GLOBALS (superglobal or automatic global) variable

December 12th, 2012 by laeeq | No comments

$GLOBAL is a php super global or automatic global variable which can be used in place of ‘global‘ keyword to access variables from global scope. This simply means that it is available in all scopes throughout a script. There is no need to do global $variable; to access it within functions or methods.

Read Full Post »

Shuffle String Randomly Using PHP Function

December 11th, 2012 by laeeq | No comments

The str_shuffle function is used to shuffle all the characters of a string randomly. The function is mainly used for generating a random password or produce random characters for CAPTCHA validation image. Each time str_shuffle function executes and it will randomly re-shuffle the string

Read Full Post »

PHP Garbage Collection

December 4th, 2012 by laeeq | No comments

PHP garbage collection is largely a reference counter. If you are keeping references which are still accessible around these will easily add up if not freed. PHP has built-in function to manage that garbage collection or memory cleanup for long-running scripts. these php functions can easily improve your site performance. Below is the php script for garbage collection that’s surely work for you.

Read Full Post »

PHP 5.4.9 and PHP 5.3.19 released

November 30th, 2012 by laeeq | No comments

The regular PHP updates are released for PHP 5.4.9 and PHP 5.3.19. The PHP development team has announced the immediate availability of PHP 5.4.9 and PHP 5.3.19. These releases fix over 15 bugs. All users of PHP are encouraged to upgrade to PHP 5.4.9and PHP 5.3.19.

Read Full Post »

HTTP authentication with PHP

November 30th, 2012 by laeeq | No comments

We often need to protect a certain block, file or a set of files, in order to prevent unauthorized access to those files or block. There are many alternatives to do this like sessions, cookies, JavaScript and HTTP authentication. Here in this post we are going to discuss HTTP authentication.

Read Full Post »

PHP 5.5.0 Alpha1 Version released for Development Preview

November 17th, 2012 by laeeq | No comments

The regular PHP updates are released for PHP 5.5.0 Alpha1. The PHP development team announces the immediate availability of PHP 5.5.0 alpha1. This release marks the beginning of the PHP 5.5.0 release cycle. All users of PHP are encouraged to test this version carefully, and report any bugs in the bug tracking system.

Read Full Post »

Secure your PHP script by hiding extensions

November 2nd, 2012 by laeeq | No comments

In general, security by obscurity is one of the weakest forms of security. Suppose If I were exploiting a site, I wouldn’t check what scripting language the site runs on, because all that would matter to me is exploiting it. Hiding the fact that you use x language isn’t going to prevent me from bypassing poor security. But in some cases, every little bit of extra security is desirable.

Read Full Post »