Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-05-2012, 03:54 AM   PM User | #1
B_Bop
New to the CF scene

 
Join Date: Sep 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
B_Bop is an unknown quantity at this point
Need advice

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
B_Bop is offline   Reply With Quote
Old 10-05-2012, 06:09 AM   PM User | #2
durangod
Senior Coder

 
Join Date: Nov 2010
Posts: 1,177
Thanks: 214
Thanked 31 Times in 30 Posts
durangod is on a distinguished road
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

Code:
$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.
durangod is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:17 AM.


Advertisement
Log in to turn off these ads.