Advertisement
Guest User

Untitled

a guest
Apr 12th, 2016
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. <?php
  2. // establishing the mysqli connection
  3. $con = mysqli_connect("localhost","root","","USERS");
  4.  
  5. if(mysqli_connect_error())
  6. {
  7. echo "My SQLi Connection was not established:".mysqli_connect();
  8. }
  9. //checking the user
  10. if(isset($_POST['login'])){
  11. $Password = mysqli_real_escape_string($con,$_POST['Password']);
  12. $sel_userName= "sel*from users where userName='userName AND Password='$Password'";
  13. $run_userName = mysqli_query($con,$sel_userName);
  14.  
  15. $check_userName = mysqli_num_rows($run_userName);
  16.  
  17. if(check_userName>o){
  18. $_SESSION['userName']=$userName
  19. echo "<script>window.open(‘NEW.php’,’_self’)</script>";
  20. }
  21. else{
  22. echo"<script>alert('Username or password is incorrect,try again!’)</script>';
  23. }
  24. }
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement