Monthly Archives: July 2006

Random number in PHP

Real quick little function to get a random number using PHP. The variable $x will contain a random number between 1 and 100. It’s rand(min, max) if you don’t want to use 1 and 100 as your limits.

Posted in Programming | Leave a comment

Get server operating system in PHP

This function returns ‘win’ if running on a Windows server and ‘linux’ if not running on a Windows server. It should be pretty easy to extend it to match other server operating systems, but this is all I needed.

Posted in Programming | 4 Comments

is_safe_mode function for PHP

The following function will return TRUE if the server is running PHP in safe mode. It uses the function ini_get, which may be disabled. If ini_get is disabled then the function also returns TRUE since the assumption that any server … Continue reading

Posted in Programming | Leave a comment

Get ImageMagick version with PHP

Knowing what version of ImageMagick is usually important if you’re going to be shelling to it to perform tasks. For me it was the –sepia-tone option that was added in either 6.2.1 or 6.2.2. Prior to that, using that option … Continue reading

Posted in Programming | 5 Comments

robots.txt for SimpleMachines forum

Wanting to keep pages out of the SERPS that I felt shouldn’t be there I started using the following robots.txt file on a SimpleMachines forum site of mine.

Posted in Internet | Leave a comment

robots.txt for WordPress – short & sweet

On my first WordPress site I went and added all of the files I didn’t want search engines indexing to my robots.txt file thinking that it was necessary to keep them out of the SERPS. But WordPress makes it easier … Continue reading

Posted in Blogging | 2 Comments

SEO company sending me spam

You know, I’ve pretty well accepted that I’m going to have email spam get through to my inbox. Even with Thunderbird’s spam filtering, it still gets through. But today I got a spam message from an SEO company called The … Continue reading

Posted in Internet, Programming | Leave a comment

Blocking AdSense ads on your own site

One of the fears of AdSense users is that they will accidentally click on an ad on their own site and get banned by Google. I’ve always assumed that these fears are a little over-hyped. I just can’t see one … Continue reading

Posted in Internet, Programming | 1 Comment

file_get_contents function for PHP 4

One of the functions added in PHP 5 is file_get_contents. This function allows you to just pass a file name and it will return the entire contents of the file. That’s all well and good if you’re using PHP5, but … Continue reading

Posted in Programming | Leave a comment

100,000,000 spam postings blocked

Akismet recently passed the 100,000,000 mark on spam messages blocked. Based on the assumption that you spend 1 second per spam message that hits your blog, they estimate that they have save blog authors 27,777 hours by blocking these postings. … Continue reading

Posted in Blogging | Leave a comment