Some times I need to fetch a page with its headers. The problem is that the cURL library can return both but there is no default way to ask for both of them separate. So here is a work around which works for most of the cases.
Some times we need to search the contents of many files through php. Personally I wrote this piece of code when I was using eaccelerator, and used it to search the whole server for files that are not compiled.
There are many cases that we need to display different content to our users depending on the location that they are visiting our site. In this tutorial we will give some examples regarding geo targeting with php.
Recently after a server crash, I wanted to know which of my sites have the most users online. Knowing that information would help me to determine which site is having the extra traffic, but what is the faster way to do this?
Recently I came to a major problem with our server. After installing the mod_evasive to our server, the module treated Google bot like a Ddos attacker. The results is that there are thousands of pages in our sites that Google can't crawl, and that way we lose a lot of traffic.
In this tutorial I will try to write some basic tips on how to optimize your php code. In general those are some very basic information that can make your writing style better, and your code run faster.
Some times we want a php script not to be able to run from a web browser. For example a database backup script. This is reasonable as someone that knows the url of this script can easily abuse our web server.
A design flaw which can have really bad results is widely spread - not checking your form fields correctly. Here's how to make it better - yet note, the used htmlentities() function has a flaw itself in apache 2.2.2 so update to 2.2.3 which contains php 5.2.0.
Latelly I was trying to optimize a perl script, and I realized that it had too many comments. Actually the half size of the script was comments, so I thought it would be easier for the perl intepreter if all the comments and empty lines would be removed from the script.