php

Create Dynamic Date Selects

If you ever require users to submit a date using an online form, perhaps a birthday or an expiry date, a good way to eliminate spelling mistakes and format the submitted date how you want is to provide drop down ’select’ elements. Using PHP, we can easily create dynamic select elements for the day, month [...]

Dynamic Copyright Date

Ok, we’ve all got the standard copyright notice at the bottom of our web pages, something like © 2009.

© 2009

But let’s be honest, nothing looks worse than a copyright statement when the year is out of date! It gives the impression that you don’t care.
You can easily prevent this by using the php date() [...]

Create Your First AJAX Request (Part Three)

The complete script can be downloaded here
In the last part of this series, we’ll create ’showdetails.js’. This will turn our web page into a AJAX-powered web page!
In the first part we created the XMLHttpRequest Object. Now we need to create an instance of it.

Create Your First AJAX Request (Part Two)

An example of what you’re creating can be seen here.
The complete script can be downloaded here
In the first part, we created a function, getRequestObj(), that we can now use to initiate a new XMLHttpRequest object.

Create Your First AJAX Request (Part One)

AJAX is now everywhere on the web. The ability to update content on the web page without reloading the page provides a slicker experience to the user whilst also reducing the load on the server (the server only needs to output the updated content and not the entire page).

Simple Random Image With PHP

We’ve already covered ‘creating a random image with JavaScript’ but the best way to produce a random image on each page load is to use PHP. Using PHP, you are not relying on the browser supporting JavaScript at all and everyone will see the random images.
OK, to start, we’ll create a function called randomSelect(). This [...]