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.
A php script that you can use to post your blog's feed to twitter. The script will convert urls using the twt.gs url shortening service, and it will post it to twitter along with the post's title.
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.
Recently I moved a feed to FeedBurner. The problem was that I wanted to redirect old users to the new feed url, but in the same time allow FeedBurner to visit the old feed in order to crawl it.
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.
Bellow is a modification for the popular phpLD directory script which gives you the abillity to dissalow spammers from submiting their sites to your directory.
The script uses a blacklist and disallow submittions for every domain you want, including subdomains.
This tutorial will teach you how to properly handle user submitted data as well as displaying it, and even protecting the pages the scripts are run from.
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.
As we faced some spam problems with the trackback bot, I thought to write a simple function that checks if a message contains "bad words", in order to prevent comment spam.
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.