Notes:
This project came from a real need. One of the web sites I manage has a guestbook which receives 2-3
computer generated guestbook entries every day. For the most part, I have used other code to keep the
messages from actually posting to the guestbook (I get an e-mail each time the form is submitted), but
I had often though about using a random image to ensure (or better ensure) human user input for the guestbook.
I designed the images (25 in all) in photoshop and put them all in the same folder, with the file name
equal to the text on the image. There is an array with all of the names and after getting a random number
(between 0 and 24), the image is displayed and a hidden input holds the value which is evaluated on submit.
There is also a hidden input to tell whether this is an insert or update action - which has more to do
with the process page.
The guestbook then goes to a process page, which is vbscript, and inputs the data into a database. The
user is redirected to the view page (the process page is transparent). The data is then drawn from a
database. Feel free to submit to the guestbook and let me know what you think. Also, refresh the page,
use the reset button or return to the page and you will see a different image.
I could have made the verification code case insensitive, but I left it like it sensitive. Also, I used
the password generator from an earlier assignment to make the random passwords. I did go through an remove
the number 1 and the letter O from the passwords, since they could be construed as a lowercase L or the
number 0. |