www.webdeveloper.com
Results 1 to 3 of 3

Thread: filter_var sanitize not working...?

  1. #1
    Join Date
    Mar 2010
    Posts
    281

    filter_var sanitize not working...?

    i've been trying out some different types of form validation. this filter_var URL sanitize is not working. anyone know why? here's my example:

    PHP Code:
    $url "http{}://ww()w.websi\\tead{}#dress.com";

    $url filter_var($urlFILTER_SANITIZE_URL);

    echo 
    "Using the filter_var sanitize thing URL is now..." .$url
    it returns this ->http{}://ww()w.websi\tead{}#dress.com


    thank you!

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,918
    The description of that filter says:
    Remove all characters except letters, digits and $-_.+!*'(),{}|\\^~[]`<>#&#37;";/?:@&=.
    So it appears to me to be working as designed. As to whether or not that's what you want it to do is another question.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Mar 2010
    Posts
    281
    hmmmmm...

    thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles