i don't know why but this is not working:
I am working on an Ajax send , i have send a value to a PHP script which parses the values and store the values in a php variable. and now:
$id = $_GET['id']; $url = $_GET['url']; $check = $_GET['check']; $filid = mysql_real_escape_string($id); $filurl = mysql_real_escape_string($url); if($check == 'true'){ $insert = "INSERT INTO tab (id,url) VALUES ('$filid','$filurl')"; mysql_query($insert) or die(mysql_error()); } I am confirmed that my Ajax code is working , i'm not sure about php.When i remove the if statement and directly put the data into my database , it's working.
I'm new so please tolerate. I hope someone can point me out my mistakes are.
Thanks!
$_GET['check']actually contain?mysql_real_escape_stringbefore you insert GET values into your tables. This code is prone to SQL injection: nl.php.net/manual/en/function.mysql-real-escape-string.php