Advertisement
melody45

login-reg

Mar 25th, 2015
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <?PHP
  2. session_start();
  3. /////checking login status
  4. include_once('db_connect.php');
  5.  
  6. if(isset($_REQUEST['u_email']) && ($_REQUEST['u_email'] && $_REQUEST['u_pass']))
  7. {
  8. $u_email=mysql_real_escape_string($_REQUEST['u_email']);
  9. $u_pass=mysql_real_escape_string($_REQUEST['u_pass']);
  10. $qry_login = "SELECT * FROM users WHERE email='$u_email' AND password='$u_pass' AND status=0";
  11. $qry_result = mysql_query($qry_login);
  12.  
  13. $rows=mysql_fetch_array($qry_result);
  14. $_SESSION['userindex'] = $rows['userindex'];
  15. $u_id = $rows['userindex'];
  16. $_SESSION['status'] = $rows['status'];
  17. $_SESSION['u_email'] = $rows['email'];
  18. $_SESSION['u_name'] = $rows['uname'];
  19.  
  20.  
  21. echo"<script>location.href='../index.php'</script>";
  22.  
  23. }
  24. else
  25. {
  26. echo"<script>location.href='../index.php?error_login=1'</script>";
  27. }
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. //echo $u_email." ".$u_pass;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement