Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //Checking if both input fields are set
- if (isset($_POST["username"],$_POST["password"])){
- //Checking if username/password matches your defined username/password
- if (trim($_POST["username"]) == "yourusername" && trim($_POST["password"]) == "yourpassword"){
- header("Location:https://google.com");//Redirect to google.com
- die;//Stop the script
- }
- }
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
- <title>Redirect on login</title>
- </head>
- <body>
- <form action="<?php echo $_SERVER["REQUEST_URI"]; ?>" method="post">
- <label>Username: <input type="text" name="username"></label><br>
- <label>Password: <input type="password" name="password"></label><br>
- <input type="submit">
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment