cswells Posted April 15, 2010 Share Posted April 15, 2010 $sql_check_e = "SELECT * FROM `tbl` WHERE `email`='".$email."'"; $res_check_e = mysql_query($sql_check_e) or die(mysql_error()); if(mysql_num_rows($res_check_e) == 0){ echo "The email you supplied does not exist, please regiester <a>here</a>\n"; }else{ $sql_password = "SELECT * FROM `tbl` WHERE `email`='".$email."' AND `password`='".md5($password)."'"; $res_password = mysql_query($sql_password) or die(mysql_error()); if(mysql_num_rows($res_password) == 0){ echo "Email or password is invalid"; }else { //at this point login is successful $user_data = mysql_fetch_array($res_check_e); <says error is here $username = $userdata['username']; setcookie($username,$email,time()+3600); I have the user login with Email and Password, but i want the Cookie to store the Username, and email. The error i get is "Notice: Undefined variable: userdata" Any help would be key. I am probably making a mistake thats right in front of me and yet don't get it. Quote Link to comment Share on other sites More sharing options...
taquitosensei Posted April 15, 2010 Share Posted April 15, 2010 $user_data = mysql_fetch_array($res_check_e); <says error is here $username = $userdata['username']; $userdata!=$user_data Quote Link to comment Share on other sites More sharing options...
cswells Posted April 15, 2010 Author Share Posted April 15, 2010 I just found this.... :'( Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.