Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <?php
- if(isset($_POST['submit'])){
- $user = $_POST['username'];
- $pass = $_POST['password'];
- if($user=="admin" && $pass=="admin"){
- /* Redirect to a different page in the current directory that was requested
- $host = $_SERVER['HTTP_HOST'];
- $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
- $extra = 'mypage.php';
- header("Location: http://$host$uri/$extra");
- */
- header("Location: www.google.com"); //This will redirect you to google
- }else{
- echo("error ! please enter correct data!");
- }
- }
- ?>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Untitled Document</title>
- </head>
- <body>
- <form action="" method="post">
- <table align="center">
- <tr>
- <td>username:</td>
- <td><input type="text" name="username" placeholder="enter your username"></td>
- </tr>
- <tr>
- <td>Password:</td>
- <td><input type="password" name ="password" placeholder="enter your password"></td>
- </tr>
- <tr>
- <td></td>
- <td><input type="submit" name="submit" value="submit"</td>
- </tr>
- </table>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement