Spam bots and email harvesting bots crawl web sites to find email addresses. It is important to hide the email addresses on your site. The best way of doing this is to turn the email address into an image.
How it Works
The PHP script uses the GD image library and converts text into an image. Since bots cannot “read” images, it cannot get your email address. When I want my email address to appear I use the
<img> tag like so
<img src="http://email@example.com">. The text is sent to a PHP file which takes the text and parameters like text size and angle and converts to an image. Read More » »
Some websites have how long it took to execute the website near the bottom of their pages. This can be entertaining, but it also servers another important purpose. I often use it to see if one of my pages is taking too long to load or hanging. To use this simple script, place this code at the top of your script:
$time = explode (' ',microtime());
return(double) $time + $time;
$startTime = getCurTime();
And this at the bottom of your script:
$endTime = getCurTime();
echo "Time to Execute = ".number_format(($endTime - $startTime),2)." seconds";
You can change the “2″ in the
number_format() function to however many decimal places you want. Below it is set to 6. If you notice your webpage taking too long to load, but not sure what piece is holding it up, you can move the script to the middle of the script or somewhere else and try to narrow it down that way.
Below is the same script but instead of measuring the execution time for the entire page, it just calculates the time it takes to execute the content of this blog post.
Time to Execute = 0.000020 seconds
Most all websites have a copyright disclaimer at the bottom of the page, but having a copyright line that is out of date can make a website look as if it is rarely updated. This simple php script keeps the copyright year current.
echo '© '.date("Y").' - Website Name';
The code above Read More » »