View Full Version : Need advice

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)) {
echo $email;

$email = false;
$approve= false;

if(isset($_POST['p']) && !empty($_POST['p'])){
$pass= hash('sha512',$_POST['p']);
echo $pass;
$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->bind_result($user_id, $username, $db_password, $salt);
if($stmt->num_rows == 1) {
echo 'yes';



thanks in advance

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.