I have this user verification file:
<?php
session_start();
require 'db-D.php';
$email = $_GET['email'];
$code = $_GET['code'];
$sql = 'UPDATE `login_D` SET `active`= 1 WHERE email=\"'.$email.'\" and code=\''.$code.'\'';
$conn->query($sql) or $_SESSION['message'] = 'invalid URL' and $_SESSION['details'] = null and header('location: error.php') and die();
header('location: login.php');
?>
I send the user a mail and then use GET method to retrieve the info. The URL looks like this:
192.168.0.101/verifiy.php?email=somemail@mail.com&code=c16c0745def04703e62daa72270c9a89c113a0b208ddd0072b6f828fe1adc81b
The problem is that when I query $sql
I get no errors and when I check the active value on PhpMyAdmin it is 0 not 1.
I ran the same script (with the values manually inserted) on PhpMyAdmin and the value changed.
I also looked at the log files (apache and php) and there are no errors.
I am running a LAMP server on a raspberry pi 3.