hey, i need to make this form in php, and i need to have the following be REQUIRED!
-name
-comments
it is a contact us form
how do i add a string REQUIRED so the user must fill in the form without it being sent?
hey, i need to make this form in php, and i need to have the following be REQUIRED!
-name
-comments
it is a contact us form
how do i add a string REQUIRED so the user must fill in the form without it being sent?
a very noobish way(my way) would be to check after having been submitted by checking $_POST("name") and seeing its empty or not. Basically going thru a series of checks on the values when submitted, maybe checkform.php or somethin, then giving error messges and having users go back and fixing the issue in the browser.
It's not a "very noobish" way at all, it's perfectly good. I suggest, though, that rather than have the user go back, you header() them back to the form page with a list of errors at the top and the previous values filled in, or even submit to the same page.
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
Bookmarks