the best way to sanitize user input

Discussion in 'PHP' started by komendan, Nov 13, 2010.

  1. #1
    hello,
    i need your advice on sanitizing user input (get/post). Is there any best way (php script) to do this?
    please suggest any php regex...
    thank you
     
    komendan, Nov 13, 2010 IP
  2. d_s

    d_s Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    hi there,

    It depends on the type of data that you need to sanitize. try out the regexlib.com it is full of regex resource.
    regards,
    d_s
     
    d_s, Nov 13, 2010 IP
  3. Gray Fox

    Gray Fox Well-Known Member

    Messages:
    196
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    130
    #3
    If you're looking for query sanitation, look for a DBAL (ie. Zend_Db, Doctrine); if you're looking for XSS protection, don't sanitize user input but escape output.
     
    Gray Fox, Nov 13, 2010 IP
  4. komendan

    komendan Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    hi,thanks for the suggestion. i've been there but this site is not easy to navigate.

    Helo gray,
    Could you please be more specific? any example or url address?
    thanks
     
    komendan, Nov 15, 2010 IP