Advertisement
Guest User

Untitled

a guest
Mar 1st, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4. $USER=$_POST["txtuser"];
  5. $PWD=$_POST["txtpassword"];
  6. $con = mysql_connect("localhost","root","");
  7. if(!$con)
  8. {
  9. die('Coulld not connect: ' . mysql_error());
  10. }
  11.  
  12. mysql_select_db("cs3a", $con);
  13. $result = mysql_query("SELECT * from access WHERE Username='$USER' and Password='$PWD'");
  14. $found = mysql_num_rows($result);
  15.  
  16. if($found){
  17.  
  18. $_SESSION["accessed"] = 1;
  19. echo "<center><h1> access granted. </h1> </center>";
  20. <?php
  21.  
  22. session_start();
  23. $USER=$_POST["txtuser"];
  24. $PWD=$_POST["txtpassword"];
  25. $con = mysql_connect("localhost","root","");
  26. if(!$con)
  27. {
  28. die('Coulld not connect: ' . mysql_error());
  29. }
  30.  
  31. mysql_select_db("cs3a", $con);
  32. $result = mysql_query("SELECT * from access WHERE Username='$USER' and Password='$PWD'");
  33. $found = mysql_num_rows($result);
  34.  
  35. if($found){
  36.  
  37. $_SESSION["accessed"] = 1;
  38. echo "<center><h1> access granted. </h1> </center>";
  39. }
  40. else{
  41. $_SESSION["accessed"] = 0;
  42. echo"<center><h1>Unknown User.<a href='index.php'>Try Again? </a></h1></center>";
  43. die("<center><h2> access denied</h1></center>");
  44.  
  45.  
  46.  
  47. }
  48.  
  49.  
  50.  
  51.  
  52. mysql_close($con);?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement