Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. INDEX.PHP
  2.  
  3. <html>
  4.  
  5. <form action="login.php" methood="POST">
  6. Username: <input type='text' name='username'/><br/>
  7. Password: <input type='password' name='password'/><br/>
  8. <input type='submit' value='Log In'/>
  9. </form>
  10.  
  11. </html>
  12.  
  13.  
  14. LOGIN.PHP
  15.  
  16. <?php
  17.  
  18. $username = $_POST["username"];
  19. $password = $_POST["password"];
  20.  
  21. if ($username && $password)
  22. {
  23.  
  24. $connect = mysql_connect('localhost','root','') or die("Couldn't Connect");
  25. mysql_select_db('php_login') or die("Couldn't finf database");
  26.  
  27.  
  28.  
  29. }
  30. else
  31. die("Please enter a username and a password");
  32.  
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement