Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking for quotes, semicolons in user input

Status
Not open for further replies.

sm43

Programmer
Dec 1, 2002
155
US
Hi,
Can anyone guide me with how to do user-input verification for semi-columns, quotes etc in php- i'm building a query out of these inputted values.

What do I replace them with?

I'm reading in posts/articles to look for these as they mess up the query (though whether strictly in a syntactical way or by compromising security-that I'm not fully sure of).

Would greatly appreciate the help!


Thanks.

Saad
 
Insufficient data for a meaningful answer. You have not specified what database backend you are using -- I will assume MySQL.

Check out mysql_escape_string () ( It will not remove potentially dangerous characters, but will instead escape them (with backslashes) so that they can be used in queries with MySQL. Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top