Disable Direct Access to a Script With PHP

A question was asked in the comments for "Make Your Own Ajax Contact Form" about preventing a PHP script from being accessed directly.

This can be done for security reasons. In the example of the Ajax contact form tutorial, it would be to prevent potential spammers from taking advantage of a security vulnerability.

Using PHP In the Command Line

Have you ever thought of an idea to do something with PHP, and wanted to test it out? You probably have to go through the trouble of writing your script, starting a server, and testing it in your browser.

Perhaps you love using PHP, and would like to do more than web development with it. You might like it as a more readable version of Perl.

Make Your Own Ajax Contact Form

Ajax is an awesome technique, which allows for server-side stuff to be done without the user having to even refresh a page.

One common use for Ajax is contact forms. So today, we're going to create just that. Once you understand how to make a contact form, you can easily figure out how to use the same techniques to do just about anything.

Automatically Update Your Copyright Date

It's the year 2010 now, and just like how you may need a new calendar, you've probably gone and updated the copyright date in your site's footer. It's one of the more boring parts of website maintenance that we all have to deal with.

But if you're using PHP, you can avoid this little bit of extra work with a simple little PHP one-liner. Some might already know this, but it can be useful for beginners.

Customizing the Home Page of Your CMS

I recently got a question from a reader following the "Creating a PHP CMS" series of tutorials asking about customizing the home page to be different from the rest of the site.

Continue reading to find out how to customize the home page in our simple CMS.