Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- Q: Create a login page using php and create cookie using the information from the user and display the cookie. -->
- <!DOCTYPE html>
- <html>
- <head>
- <title>Login</title>
- </head>
- <body>
- <center>
- <form method="POST" action="index_cookie.php">
- <b><h1>Login </h1></b><br><br>
- <input type="text" name="name" placeholder="Name"><br><br>
- <input type="password" name="pass" placeholder="Password"><br><br>
- <input type="submit" value="Submit" >
- <input type="button" value="cancel">
- </form>
- </center>
- </body>
- </html>
- cookie.php
- <?php
- $name = $_POST["name"];
- $pass = $_POST["pass"];
- setcookie("login[name]", $name);
- setcookie("login[password]", $pass);
- ?>
Add Comment
Please, Sign In to add comment