Jump to content

Archived

This topic is now archived and is closed to further replies.

spfoonnewb

Validating User Input

Recommended Posts

Validating user posted data:

I want to remove any HTML using: mysql_real_escape_string or strip_tags

I also want to remove invalid characters, ( - , ! , # , % , ^ , & , * , ( , ) , AND , OR , WHERE , etc.... )

This will be to prevent MySQL injection, can anyone help?

Share this post


Link to post
Share on other sites
http://www.php.net/str_replace

Use an array of all the characters you want to replace for the first arguement.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.