Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Server-side Scripting _ Form Validation Help...

Posted by: JohnDC Oct 20 2007, 03:26 PM

Hello, this is my first post to this board. Thank you all for being here. Here is my question:

Within my html form, I would like to include a question that must be answered correctly in order for the form to be submitted. The purpose of the form is for musicians and artists to submit details of upcoming performances (venue name, date, time, etc.). Now since I've been getting a lot of spam through this, I've included the question of "Venue City?" Since my service only lists events in the city of Alexandria, VA, I want the field to only contain "Alexandria" to be successful. Other fields are also required, but not a specific entry. I've spent quite a few hours today searching Google for a solution with no luck. Keep in mind I'm not a professional programmer/coder. smile.gif Is there a solution? Thanks in advance. ~John

Here is the link to that form: http://www.alexandrialive.com/submit.html

Within the website: http://www.alexandrialive.com

Posted by: pandy Oct 20 2007, 04:25 PM

It looks like you use a script controlled by your host and not by you. Is that correct? You need to use a script that you can make changes to. unsure.gif

CODE
<FORM action="http://formmail.dreamhost.com/cgi-bin/formmail.cgi" method="post">


I move this to the Server-side Scripting forum. You have a better chance to get an answer there. smile.gif

Posted by: Darin McGrew Oct 20 2007, 04:29 PM

Please see the FAQ entry http://www.htmlhelp.com/faq/html/forms.html#required-fields

Posted by: JohnDC Oct 22 2007, 09:57 AM

QUOTE(Darin McGrew @ Oct 20 2007, 05:29 PM) *

Please see the FAQ entry http://www.htmlhelp.com/faq/html/forms.html#required-fields


Thanks for that link, but that was one of the sites I looked at before posting this message. That page didn't help at all (as a novice programmer). I've also read about email validation too, but this is different. I was able to impliment a warning about not filling in the correct city name - but since the hidden input field only check to see if the entry was completed - it sends the form anyway after warning me about the wrong city name. What I need is something that check to see if and entry is valid first before checking to see if it's just completed - or at the same time.

Thanks for any help. I'm googled out. ~John

Posted by: Darin McGrew Oct 22 2007, 11:13 AM

You need to update your formmail.cgi script, or get another script that does what you want it to do.

Posted by: JohnDC Oct 22 2007, 12:18 PM

Thanks again Darin, now I'm getting somewhere. I also got this reply from my server's support team: Thanks for your guideance. I'm going to look for a new script now.

"Well it appears that your using our form mail script. That form doesn't
have any checking system built into it. The only thing you can do is set
that field to required and then it will reject the form if that is blank,
but it will not check to see if it was actually Alexandria.

Since our form mail script doesn't have that capability you would really
have to setup your own form mail script. Your custom form mail script
could then require that field have the input that you want.

I'm sure there are form mail scripts out there that would do this, or
would use a captcha or some other spam prevention system, though I don't
really have one I can recommend.

With some PHP knowledge you could build one yourself.
http://wiki.dreamhost.com/PHP_mail()
http://wiki.dreamhost.com/PHP_Form_Processing"

Posted by: Brian Chandler Oct 22 2007, 03:07 PM

QUOTE
Thanks again Darin, now I'm getting somewhere. I also got this reply from my server's support team: Thanks for your guideance. I'm going to look for a new script now.


Their reply isn't entirely the most helpful. Can't you make a copy of their script and simply add the check, instead of having to start again? (This incidentally is the point of (speech-)free software.) Writing a demonstration emailing script is very easy indeed, but making one that can't easily be used for spamming is a lot harder.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)