Creating a PHP Styleswitcher

One of the benefits of creating a CSS-rich website is that you can change how the website looks completely, simply by creating a new stylesheet. This means that you can skin your CSS-based website using multiple stylesheets, instead of the old route of creating separate header and footer include files. Once you’ve created your stylesheets […]

PHP Mail Form: Secure and Protected

The one major downside to the ever-changing fast paced cyber world that we call the Internet is the speed at which code becomes outdated and new security issues are discovered. This tutorial covers the basics as set forth in previous tutorialtastic mail form guides with new, more advanced security techniques and spam-blocking measures. Firstly, the […]

Basic Image/Ad Rotation Script

Rotation scripts can come in handy for many things — multiple decorational images for your website, photograph rotational scripts, banner advert rotations and more. This basic script will provide a quick ‘no frills’ rotation method which can be placed anywhere on a PHP-enabled website. First, we need to ‘open’ PHP and declare the array which […]

Creating an Error Reporter

This tutorial will guide you through creating a form that allows people to report errors (typos etc) they find on your website (as previously seen on The first step is to create the actual form. We need three fields: page URL, error and correction. This allows visitors to pinpoint exactly where and what the […]

PHPFanBase JavaScript Spam Protection

Note: PHPFanBase is an old script with known security issues. Use with caution. This tutorial will show you how to implement basic JavaScript protection to deter automated spam bots from filling in fake applications at your PHPFanBase-powered fanlisting. Open join.php and find the following line (and fix the typo “Subtmit”; this should be “Submit”): <td><input […]

Securing Your Passwords

Most people have their MySQL connection strings and other important data in a config/functions file in the main public_html directory. One badly set permission, or even a server glitch, can cause this file to become exposed leaving it vulnerable to direct attack via URL. The solution? Ensure the file cannot be accessed via URL by […]

Enth3 JavaScript Spam Protection

Open show_join.php and near the bottom, find this: <input type="submit" value="Join the <?php echo $info[‘listingtype’]; ?>" class="enth3_submit" /> ..just before it, add: <script type="text/javascript"> <!– document.write(‘<input type="hidden" name="spamproofing" id="spamproofing" value="SPAMWORD" />’); //–> </script> <noscript><div>JavaScript must be enabled to join due to spam restrictions in place.</div></noscript> At the top of the file, after this: if( isset( […]