Guest User

loginphp

a guest
Mar 15th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2. session_start();
  3.  
  4. require_once 'conn.php';
  5.  
  6.  
  7. if(isset($_POST['Submit'])){
  8. $user = $_POST['uname'];
  9. $pw = $_POST['pw'];
  10. $pword = md5($pw);
  11.  
  12. try{
  13. $result=$mysqli->query("Select count(*) t from test.tbl_users where user_name='".$user."' and user_password='".$pword."' ");
  14. if($result){
  15. $row= $res->fetch_assoc();
  16. echo $row['t'];
  17. if($row['t']){
  18. echo "ok";
  19.  
  20. }else{
  21. echo "<script> alert('NOT EXIST'); </script>"
  22. }
  23. }
  24. }
  25. catch(Exception $e){
  26. echo "<script> alert('".$e->getMessage()."''); </script>";
  27. }
  28. }
  29.  
  30.  
  31.  
  32. ?>
Add Comment
Please, Sign In to add comment