User12222

WT04

Mar 14th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. <html>
  2. <body>
  3. <form action="database.php" method="post">
  4. Username
  5. <input type="text" name="username">
  6. <br>
  7. Password
  8. <input type="password" name="password">
  9. <br>
  10. <input type="submit" name=submit>
  11. </form>
  12. </body>
  13. </html>
  14.  
  15. php FILE:-
  16. <?php
  17. $user=$_REQUEST['username'];
  18. $pass=$_REQUEST['password'];
  19. $server="localhost";
  20. $usern="liet";
  21. $passw="liet";
  22. $database="wtprograms";
  23. $tablename="user_detail";
  24. if($user && $pass)
  25. {
  26. $connect=mysqli_connect($server,$usern,$passw) or die("not connecting");
  27. mysql_select_db(database) or die("no db:");
  28. $query=mysql_query("SELECT * FROM $tablename WHERE username='$user' and password='$pass' ");
  29. $numrows=mysql_num_rows($query);
  30. if($numrows!=0)
  31. {
  32. echo "\n\n\nHello" . $user. "Welcome to this page";
  33. }
  34. else
  35. {
  36. echo $user. " does not exist!";
  37. }
  38. }
Add Comment
Please, Sign In to add comment