I'm getting and Error 500 from my server. I'm not sure why... I think it might be my code. Can someone take a look please.
localhost is currently unable to handle this request.
HTTP ERROR 500
<?php
include("common/common.php");
include("../common/db_connector.php");
$email_sent = $_POST["inputEmail"];
$password_sent = md5($_POST["inputPassword"]);
// Check database for user credentials...
$sql = "SELECT * FROM users WHERE email = '$email_sent'";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
//checks for true conditions if password and meail match database......
if($email_sent == $row["email"] AND $password_sent == $row["password"]) {
$_SESSION["username"] = $email_sent;
echo "<script>window.location = 'dashboard/index.php';</script>";
} else {
echo "<script>alert('access denied'); window.location = 'index.php';</script>";
}
}
}
//////////////////////////////////////////////
?>