+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 24

Thread: Filltering

  1. #1
    Senior Member ripkk2tfk is on a distinguished road ripkk2tfk's Avatar
    Join Date
    Mar 2009
    Location
    South Africa
    Posts
    232
    Thanks
    5
    Thanked 3 Times in 3 Posts
    Rep Power
    2

    Default Filltering

    how do I fillter chars like ` & ^ %
    Visit my site

  2. #2
    Administrator GumSlone has disabled reputation GumSlone's Avatar
    Join Date
    Mar 2005
    Posts
    1,083
    Thanks
    40
    Thanked 133 Times in 60 Posts
    Blog Entries
    2
    Rep Power
    10

    Default

    you can try something like this:

    PHP Code:
    $text preg_replace('/[^[:alnum:]\-\.\_\^]/'''$text); 
    coding-talk.com - a place where noobs become professionals

    Advertise your mobile site for FREE with




  3. #3
    Senior Member ripkk2tfk is on a distinguished road ripkk2tfk's Avatar
    Join Date
    Mar 2009
    Location
    South Africa
    Posts
    232
    Thanks
    5
    Thanked 3 Times in 3 Posts
    Rep Power
    2

    Default

    How would I put that in an if statment?
    Visit my site

  4. #4
    Administrator GumSlone has disabled reputation GumSlone's Avatar
    Join Date
    Mar 2005
    Posts
    1,083
    Thanks
    40
    Thanked 133 Times in 60 Posts
    Blog Entries
    2
    Rep Power
    10

    Default

    why into if statement?
    coding-talk.com - a place where noobs become professionals

    Advertise your mobile site for FREE with




  5. #5
    Senior Member ripkk2tfk is on a distinguished road ripkk2tfk's Avatar
    Join Date
    Mar 2009
    Location
    South Africa
    Posts
    232
    Thanks
    5
    Thanked 3 Times in 3 Posts
    Rep Power
    2

    Default

    Ok here is what I got
    PHP Code:
    $text preg_replace('/[^[:alnum:]\-\.\_\^]/'''$username);
    if(
    $text == true)
            {
            die (
    "Unsupported character(s)");
                    } 
    Last edited by ripkk2tfk; 09-01-10 at 12:14.
    Visit my site

  6. #6
    Administrator GumSlone has disabled reputation GumSlone's Avatar
    Join Date
    Mar 2005
    Posts
    1,083
    Thanks
    40
    Thanked 133 Times in 60 Posts
    Blog Entries
    2
    Rep Power
    10

    Default

    no, for what you need the filtering? password or username?
    coding-talk.com - a place where noobs become professionals

    Advertise your mobile site for FREE with




  7. #7
    Senior Member ripkk2tfk is on a distinguished road ripkk2tfk's Avatar
    Join Date
    Mar 2009
    Location
    South Africa
    Posts
    232
    Thanks
    5
    Thanked 3 Times in 3 Posts
    Rep Power
    2

    Default

    I want to remove any special characters from username, password to help prevent mysql injection as for the email I need to allow the @ symbol
    Visit my site

  8. #8
    Administrator GumSlone has disabled reputation GumSlone's Avatar
    Join Date
    Mar 2005
    Posts
    1,083
    Thanks
    40
    Thanked 133 Times in 60 Posts
    Blog Entries
    2
    Rep Power
    10

    Default

    to prevent mysql injection use: mysql_real_escape_string
    coding-talk.com - a place where noobs become professionals

    Advertise your mobile site for FREE with




  9. #9
    Senior Member ripkk2tfk is on a distinguished road ripkk2tfk's Avatar
    Join Date
    Mar 2009
    Location
    South Africa
    Posts
    232
    Thanks
    5
    Thanked 3 Times in 3 Posts
    Rep Power
    2

    Default

    Is that all I should use?
    Visit my site

  10. #10
    Administrator GumSlone has disabled reputation GumSlone's Avatar
    Join Date
    Mar 2005
    Posts
    1,083
    Thanks
    40
    Thanked 133 Times in 60 Posts
    Blog Entries
    2
    Rep Power
    10

    Default

    yes thats all
    coding-talk.com - a place where noobs become professionals

    Advertise your mobile site for FREE with




+ Reply to Thread
Page 1 of 3 1 2 3 LastLast

Thread Information

Users Browsing this Thread

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

     

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

SEO by vBSEO