Couple of years ago I wrote an article about two PHP configuration options auto_prepend_file and auto_append_file recently while browsing about PHP minification I got an idea on how to apply this PHP minify code to each and every script executed on the server so that all HTML output from that server are auto minified. This method requires creating a PHP file containing the code to strip whitespaces and newlines before and after the HTML tags and including this file with every PHP script executed on the server using the auto_prepend_file configuration option. For this you need to have access to the php.ini file. This method will work fine even if you are using shared hosting with custom php.ini support.Continue Reading…
PHP auto_prepend_file and auto_append_file
This article will show you how to use the PHP configuration directives auto_prepend_file and auto_append_file. These two PHP directives perform the same function as require() but they do it globally on all PHP scripts. The PHP auto_prepend_file and auto_append_file directives can only be used in php.ini files. They do NOT work when used in .htaccess file, I’m mentioning this so that you don’t waste precious time editing your .htaccess file. If you want to set these configuration directives on directory basis you can use them in your custom php.ini file.Continue Reading…
PHP Open Port Check Script
A quick tutorial on how to check for open ports using PHP. This function fsockopen() is used in the Open Port Check Tool in this blog. You can check whether a certain port is open on a specified IP address or hostname. Before reading take note that most FREE web hosting providers disable fsockopen() function as a security measure so first check whether the function can be used. Another thing to take note is that if fsockopen is unable to connect to a port it doesn’t necessarily mean that port is closed on the remote host, your server in which the script is running might also have block the OUTBOUND connection to that port.Continue Reading…
PHP Pie Chart Script
A PHP Pie Chart script created by me using which any data and values can be represented using the pie chart. The PHP Pie Chart script is available for free download. By passing a query string you can compare any number of values. What follows is how to use my PHP Pie Chart Script and the code to download. The PHP Pie Chart script uses the following PHP image functions ImageCreate(), ImageColorAllocate(), imagefilledrectangle(), ImageFilledArc(), imagettftext(), ImagePNG() and ImageDestroy(). To edit the code you need to know how to use these functions.Continue Reading…
W3 Total Cache Remove Footer
The W3 Total Cache is a caching plugin for wordpress which improves the performance of your wordpress blog. When this plugin is activated it inserts a HTML comment into your code which looks like this
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/ Minified using disk Page Caching using disk (enhanced) Database Caching using disk Served from: www.example.com @ 2011-07-04 06:59:27 -->
If you wish to remove W3 Total Cache Footer follow my instructions.Continue Reading…
PHP Sessions Tutorial
This PHP sessions tutorial explains how sessions work, commonly used PHP session handling functions and how to use then. A session is the time duration that starts from the time a user visits a website and ends when he/she leaves the website. Usually when we use PHP variables they can be accessed only in the script in which they are used but sessions variables can be accessed by all PHP scripts which are accessed during that “session” Sessions greatly help in personalizing an user’s experience on a website, they can also be used to create Login pages using PHP. We’ll first see how PHP sessions work.Continue Reading…