|
|
|
|
|
by krapp
4738 days ago
|
|
$email = $_POST['email'];
$password = $_POST['password'];
$query = "SELECT emailAddress, password, userID FROM users
WHERE emailAddress = '$email' AND password = '$password'";
$result = $db->query($query);
Um... not to digress but it looks to me like there's a SQL injection hole here.
Please use PDO and a bit more validation, this doesn't properly escape anything. You could validate the email address with filter_var, for instance.Otherwise, it looks neat, good job. You might want to learn to code more defensively though. Especially if you're putting something up on Github. Refer to:
- https://www.owasp.org/index.php/SQL_Injection_Prevention_Che... - http://stackoverflow.com/questions/60174/how-to-prevent-sql-... for some direction towards better practices. |
|
I guess, I am also on the same path as with the author of this post. But yeah, thanks again, I will improve it as soon as I can. :-)