paraschhabra96

login.php

Jun 24th, 2016
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. <?php
  2.  
  3. $CUSTID=$_POST['CID'];
  4. $PASSWORD=$_POST['PASS'];
  5.  
  6. $conn=new mysqli("localhost","root","","bank");
  7.  
  8. $sql="select accno,balance from users where custid='".$CUSTID."' and password='".$PASSWORD."'";
  9.  
  10. $result=$conn->query($sql);
  11.  
  12. if($result->num_rows()>0)
  13. {
  14. echo "Login Successfull";
  15. $row=$result->fetch_assoc();
  16. $accno=$row['accno'];
  17. $balance=$row['balance'];
  18.  
  19. echo "<br>Your account no. is: ".$accno." and your balance is ".$balance;
  20. }
  21. else
  22. {
  23. echo "<br> User doesn't exist";
  24. }
  25.  
  26. ?>
Add Comment
Please, Sign In to add comment