Guest User

Untitled

a guest
Oct 16th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.69 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title> Registration</title>
  4. </head>
  5.  
  6. <body>
  7.  
  8.     <form action='login.php' method='POST'>
  9.         Username:   <input type='text' name ='username'><br />
  10.         Password:   <input type='password' name ='password'><br />
  11.         <input type='submit' value ='Log In'>
  12.  
  13.     </form>
  14. </body>
  15. </html>
  16.  
  17. //login.php file below
  18. <?php
  19.  
  20. //$username= $_POST['username'];
  21. //$password= $_POST['password'];
  22.  
  23. isset($_POST['username']) ? $username = $_POST['username'] : 'You did not enter a Username!';
  24. isset($_POST['password']) ? $password = $_POST['password'] : 'You did not enter a Password!';
  25.  
  26. // Example usage for: Ternary Operator
  27. $action = (empty($_POST['action'])) ? 'default' : $_POST['action'];
  28.  
  29. ?>
Add Comment
Please, Sign In to add comment