Possible duplicate:
Best way to prevent SQL injection in PHP
Is this code sufficiently protected against SQL injection
if(isset($_POST['Submit'])) { $user = mysql_real_escape_string($_POST["user"]); $pass = mysql_real_escape_string($_POST["pass"]); $confirm_key=md5(uniqid(rand())); $query = mysql_query("INSERT INTO members (user, pass, mail, confirm_key, country, city, www, credo) VALUES ('$user','$pass','$_POST[mail]','$confirm_key','$_POST[country]','$_POST[city]','$_POST[www]','$_POST[credo]')") or die ("Error during INSERT INTO members: " . mysql_error()); exit(); }
Is this correct and every entrance must be protected (for example, country, city ...)?
source share