...

View Full Version : Need advice



B_Bop
10-05-2012, 04:54 AM
this code does not seem to work. need advice. i have verified it does see the email and password and also connects to db.

if(isset($_POST['email']) && !empty($_POST['email'])){

if (filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
$email=$_POST['email'];
echo $email;
}else{

$email = false;
$approve= false;
}
}

if(isset($_POST['p']) && !empty($_POST['p'])){
$pass= hash('sha512',$_POST['p']);
echo $pass;
}else{
$pass=false;
$approve= false;
}


if($email && $pass && $mysqli == true){

if ($stmt = $mysqli->prepare("SELECT id, username, password, salt FROM members WHERE email = ? LIMIT 1")) {
$stmt->bind_param('s', $email); // Bind "$email" to parameter.
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($user_id, $username, $db_password, $salt);
$stmt->fetch();
if($stmt->num_rows == 1) {
echo 'yes';
}

}

}


thanks in advance

durangod
10-05-2012, 07:09 AM
i didnt notice anything right off, but you have so many functions its hard to tell where something could be wrong. It could be in any function.

Are you getting any errors, can you share the functions with us ?

so you have checked the value of




$email && $pass && $mysqli



And they all have the correct value?



if they all have the correct value then the break in the code is after that i would think because it made it that far. So check your functions, db classes and such. You might try removing all the functions and code it freehand and see if it works, if it does then you know its your functions or classes.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum