29 Jul

Being able to program when you’re a web marketeer or SEO specialist is invaluable. Although you might not have the time to do all of your coding yourself, being able to fix code niggles and implement simple features is an asset. I’ve compiled a small list of resources that I’ve used fairly recently and thought were particularly useful.
I recently had to do some email address and date validation in a PHP script I was writing. I found 8 practical PHP regular expressions that help you to validate usernames, email addresses, dates, ip addresses and a few others.
If you have a site where image previews are important, such as on my Mum’s Local Greeting Cards website (click on a image to see what I mean), the rather neat LightBox2 library is excellent. The library is very easy to use and to include in your code. I found that it was trivial for me to integrate with PHP.
If you have a PHP-based template mini site, just like my Spy Gadgets mini site, you might want to use static filenames in the URLs. This has obvious SEO benefits for highly dynamic websites. You can convert URLs such as www.mysite.com/showpage.php?sometopic into www.mysite.com/information-about-some-topic.html. The latter technique is much more user-friendly too.
You can give a site a static-html feel about it by employing Apache’s mod_rewrite module. The easiest way to implement mod_rewrite rules is with your .htaccess files.
Finally, if you’re converting lots of dates from your MySQL database into a webpage with some date-related content, I found a list of MySQL strings to paste into PHP code to format the date.

A new how-to article is released every Tuesday!
Leave a reply