Guest User

Untitled

a guest
May 25th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <!-- Q: Create a login page using php and create cookie using the information from the user and display the cookie. -->
  2.  
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <title>Login</title>
  7. </head>
  8. <body>
  9. <center>
  10. <form method="POST" action="index_cookie.php">
  11. <b><h1>Login </h1></b><br><br>
  12. <input type="text" name="name" placeholder="Name"><br><br>
  13. <input type="password" name="pass" placeholder="Password"><br><br>
  14. <input type="submit" value="Submit" >
  15. <input type="button" value="cancel">
  16. </form>
  17. </center>
  18. </body>
  19. </html>
  20.  
  21. cookie.php
  22.  
  23. <?php
  24. $name = $_POST["name"];
  25. $pass = $_POST["pass"];
  26. setcookie("login[name]", $name);
  27. setcookie("login[password]", $pass);
  28. ?>
Add Comment
Please, Sign In to add comment