bookmark

Need PHP Function to avoid XSS and SQL injection attack


Description

Hi folks, This time I'm in some trouble. Please help me in this issue. My site will have forms with number of text fields, I'll store the form data in MySQL database and later those data will be fetched and populated on web pages. Now, the forms are filled up by users, so I need to escape all unwanted characters while keeping the necessary ones intact. Suppose I get a field data in the form of $_POST. So far I was using combination of mysql_real_escape_string, htmlentities, striptags

Preview

Tags

Users

  • @praveen

Comments and Reviews