Hey there,
when i try to execute this script it returns with just a blank page, non of the message variables are echoed, not even an error.
if($_POST['submitted'] == 'yes'){
if(empty($_POST['email']) || $_POST['email'] == ''){
$error .= "<span class=\\"error\\"><p>You need to enter your email</p></span>";
}
else{
$email = $clean->text($_POST['email']);
}
if(empty($_POST['password']) || $_POST['password'] == ''){
$error .="<span class=\\"error\\"><p>You need to enter your password</p></span>";
}
if(isset($error)){
echo $error;
}
else{
$query = "SELECT id,farmName,level,salt1,salt2,password FROM users WHERE email = :email";
$email = $clean->text($_POST['email']);
$rawPass = $clean->text(hash('sha256',$_POST['password']));
$values = array('email' => $email);
try {
$lookUp = $pdo->prepare($query);
$s = $lookUp->execute($values);
} catch (PDOException $e) {
$message = "There has been an error trying to login in::: {$e->getMessage()}";
$title = "Error!";
}
$row = $s->fetch();
if($row[0] > 0){
if($row['salt1'].$rawPass.$row['salt2'] == $row['password'])
{
$_SESSION['email'] = $row['email'];
$_SESSION['id'] = $row['id'];
$_SESSION['name'] = $row['name'];
$_SESSION['level'] = $row['level'];
$_SESSION['farmname'] = $row['farmname'];
}
$message = "You have been logged in!";
$title = "Logged in!";
}
else {
$message = "Password or email was wrong";
$title = "There was an error";
}
}
}
session_start() is the first thing after php opening tags. So that leads me to belive it is an error with the selection of the data it’s self ( am i on the right track?)
Thanks again so much