Results 1 to 3 of 3

Thread: help me here with REQUIRED!

  1. #1
    Join Date
    Sep 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default help me here with REQUIRED!

    hey, i need to make this form in php, and i need to have the following be REQUIRED!

    -name
    -email
    -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?

  2. #2
    Join Date
    Aug 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,878
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •