how do I fillter chars like ` & ^ %
how do I fillter chars like ` & ^ %
Visit my site
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
How would I put that in an if statment?
Visit my site
why into if statement?
coding-talk.com - a place where noobs become professionals
Advertise your mobile site for FREE with
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
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
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
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
Is that all I should use?
Visit my site
yes thats all
coding-talk.com - a place where noobs become professionals
Advertise your mobile site for FREE with
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks