PHP form validation

Discussion in 'PHP' started by clouting, Jun 10, 2008.

  1. #1
    hi ppl,

    have got a php question.
    i am looking to do some simple form validation using php to display error msgs n the page if a field is invalid. I have done extensive searches on google but can only seem to find 'clunky' javascript pop up validation.

    can any 1 help or give me a decent link where i can find out more.

    thanks in advance.

    clouting
     
    clouting, Jun 10, 2008 IP
  2. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #2
    jayshah, Jun 10, 2008 IP
  3. clouting

    clouting Guest

    Messages:
    120
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks,

    will give it a go
     
    clouting, Jun 10, 2008 IP
  4. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #4
    No problem :) Rep appreciated :)

    Thanks,

    Jay
     
    jayshah, Jun 10, 2008 IP
  5. priyakochin

    priyakochin Banned

    Messages:
    4,740
    Likes Received:
    138
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I think its better to use JS validation since its done in client side.
     
    priyakochin, Jun 10, 2008 IP
  6. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #6
    You're joking, right?

    Turn JS off, and what happens? The validation doesn't work! JS is too easily breakable.
     
    jayshah, Jun 10, 2008 IP
  7. softvision

    softvision Peon

    Messages:
    146
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    But server side script will consume resources. I think it very rare that some one turns off JS.
     
    softvision, Jun 11, 2008 IP
  8. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,564
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #8
    No, hundreds of thousands of people have it turned off. The server validation would consume negligible resources anyway.

    Normally I have a basic JS validation, with PHP validation for fallback.
     
    blueparukia, Jun 11, 2008 IP
  9. dreamcon

    dreamcon Peon

    Messages:
    90
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    you can find all interesting scripts on hotscripts.com

    also, you may want to visit w3schools.com
     
    dreamcon, Jun 11, 2008 IP
  10. dreamcon

    dreamcon Peon

    Messages:
    90
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    However you can do it using javascript as well.

    if you are using asp.net you can do it using ajax toolkit control
     
    dreamcon, Jun 11, 2008 IP
  11. dreamcon

    dreamcon Peon

    Messages:
    90
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    But server side script will consume resources. I think it very rare that some one turns off JS.
     
    dreamcon, Jun 11, 2008 IP