Advertisement
Guest User

Untitled

a guest
May 26th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. <?php phpinfo(); ?>
  2.  
  3. <?php
  4.  
  5. session_start();
  6.  
  7. ?>
  8. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
  9. <html xmlns="http://www.w3.org/1999/xhtml">
  10. <head>
  11. <meta http=equiv="Content Type" content="text/html; charset=utf-8" />
  12. <title>Member System - Login</title>
  13. </head>
  14. <body>
  15.  
  16. <?php
  17.  
  18. $form="<form action='./login.php' method='post'></form>";
  19. <table>
  20. <tr>
  21. <td>Username:</td>
  22. <td><input type='text' name='user' /></td>
  23. </tr>
  24. <tr>
  25. <td>Password:</td>
  26. <td><input type='password' name='password' /></td>
  27. </tr>
  28. <tr>
  29. <td></td>
  30. <td><input type='submit' name='loginbtn' value='Login' /></td>
  31. </tr>
  32. </table>
  33. </form>";
  34.  
  35. if ($_POST['loginbtn']){
  36.  
  37. $user= $_POST['user'];
  38. $password = $_POST['password'];
  39.  
  40. if ($user) {
  41. if($password){
  42. echo "$user - $password <hr /> $form";
  43. } else echo "You must enter your password. $form";
  44. } else echo "You must enter your username. $form";
  45.  
  46. } else {
  47. echo $form;
  48. }
  49.  
  50. ?>
  51.  
  52. </body>
  53. </html>
  54.  
  55. sudo cp index.php test.php
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement