Need to check if both the EMAIL_ADDRESS and ACTIVATION_CODE exist within a MySql Table, if so return "Code is valid",else "Code is NOT valid".
At present it's always returning code not valid, however I've checked the record in the table and the queried code does exist.
$email = $_POST['email'];
$acticode = $_POST['code'];
$result = mysql_query("SELECT * FROM xActivate WHERE EMAIL_ADDRESS='$email' AND ACTIVATION_CODE='$acticode' LIMIT 1");
if (mysql_fetch_row($result)) {
echo 'Code is valid';
} else {
echo 'Code is NOT valid';
}
' OR 1=1 --. Then it'll work. Else try to ask mysql_error() and read up on escaping, or parameterized queries.DROP ALL TABLESthrown in for good measure?