Computing.Net > Forums > Web Development > Guestbook security.

Guestbook security.

Reply to Message Icon

Original Message
Name: haynzee
Date: January 23, 2006 at 12:46:03 Pacific
Subject: Guestbook security.
OS: XP
CPU/Ram: na
Comment:

Hi, i am fairly new to html and i managed to create a guestbook in frontpage. It works fine except it keeps been spammed. I believe though insted of someone going on it and entering links to adult sites and others i think its some sort of automation.

I therefore wondered if i put one of those security images which displays a number then the user has to enter this i was hoping that would solve the problem.

However i havent a clue in how to make one so i have enlisted your help please.

Mark

AMD Athlon 64 3500+ sct 939
Gigabyte K8NXP-SlI
Radeon X700pro 256mb
1GB Kingston value ram 3200
Audigy 2 ZS
200GB Maxtor SATA HDD
DVD Rom


Report Offensive Message For Removal


Response Number 1
Name: Michael J (by mjdamato)
Date: January 23, 2006 at 14:33:26 Pacific
Reply: (edit)

Well, since I have no idea what kind of environment you are running (i.e. PHP/APD, MySQL database, etc., etc.) and because it appears you are just starting out and are still learning I will provide a very basic solution. To try and create your own algorithym to create those security images would be a little too advanced right now.

Just create a single code, if you will. In your form tag set the action to a javascript function such as:
action="validateForm(this);"

In the form create a text field for the password. Using the password type will replace the characters the user types with dots or asterisks. You could just as easily make it a text field:
< input type="password" name="code" >

Now create a javascript function in the head of your document to validate the value entered:
< script language="javascript" >
function validateForm(formObj) {
if (formObj.code.value = "YOURPASSWORD") {
formObj.submit;
return true;
} else {
alert("You have entered the wrong code");
return false;
}
}
< /script >

Michael J


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Guestbook security.

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 6 Days.
Discuss in The Lounge