Browsed by
Month: January 2017

Creating a Simple .htaccess redirect

Creating a Simple .htaccess redirect

RedirectMatch uses a regular expression that is matched against the URL path. And your regular expression /contact.php just means any URL path that contains /contact.php but not just any URL path that is exactly /contact.php. So use the anchors for the start and end of the string (^ and $): RedirectMatch 301 ^/contact\.php$ /contact-us.php redirect 301 /contact.php /contact-us.php

Spam Trap for Contact Form 7

Spam Trap for Contact Form 7

This plugin adds spam checks to catch contact form 7 spam. It does so in the background without annoying your legitimate users with captchas. It adds a hidden field to the your contact form 7 form and then checks when a contact form 7 is submitted for that field. If its not present, or its filled in, then we can be sure that it was a bot of some sort. It also adds the ability to check for links in…

Read More Read More

PHP Namespaces

PHP Namespaces

PHP namespaces allow you to namespace your functions! Ok, so I know that’s circular reasoning. Let’s see what that means. We’re all familiar with the way that files and folders work on our PCs. If you have two files with the same name, then they cannot exist in the same folder. So, if I have a file called notes.txt with all my work related notes, then I can’t also have a file called notes.txt with all my personal related notes…

Read More Read More

PHP: Create an installer with composer

PHP: Create an installer with composer

Composer is the current most popular package management system for PHP. Composer is used to manage package dependencies and chances are good that you’ve used it to install software before. In this article we’ll look at creating your own installer with composer for your PHP projects. Using PHP’s dependency manager, Composer you list your project’s dependencies in a composer.json file and, with a few simple commands, Composer will automatically download your project’s dependencies and set up autoloading. You can think…

Read More Read More