Advertisement
Guest User

Untitled

a guest
Jul 17th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. <?php
  2. include 'db_connect.php';
  3.  
  4. $myusername=$_POST['txbxemail'];
  5. $mypassword=$_POST['txbxpass'];
  6.  
  7. $myusername = stripslashes($myusername);
  8. $mypassword = stripslashes($mypassword);
  9. $myusername = mysql_real_escape_string($myusername);
  10. $mypassword = mysql_real_escape_string($mypassword);
  11.  
  12. $encrypted_mypassword=md5($mypassword);
  13.  
  14. $sql="SELECT * FROM tbl_user (I want to take name, contact number from table and put into varibale here.)
  15. WHERE EmailAddress='$myusername' and Password='$encrypted_mypassword'";
  16. $result=mysql_query($sql);
  17. $count=mysql_num_rows($result);
  18.  
  19. if($count==1){
  20. session_start();
  21. $status = 'online';
  22. $_SESSION['sesuser'] = "$myusername";
  23. $_SESSION['sesstat'] = "$status";
  24.  
  25. header("location:../my-account.php");
  26. }
  27. else {
  28. echo "Wrong Username or Password";
  29. echo "<a href=\"javascript:history.go(-1)\"> Try again</a>";
  30. }
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement