Build Your Site With Dynamic CSS

Image source

Changes to the style of the CSS of a website can be done very easily, with the magic of JavaScript. However, JavaScript can be disabled, so it should be avoided for important things.

The solution would be to use a server-side language, like PHP, to make it possible to create dynamic CSS files without having to resort to using JavaScript. Finally you can use dynamic CSS that works in all browser configurations.

Disable Direct Access to a Script With PHP

lock

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

cli

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

pencil

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

calendar

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.

1234