Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function showForm($error="LOGIN"){
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "DTD/xhtml1-transitional.dtd">
- <html>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- </head>
- <body>
- <style>
- .border {
- border: 1px solid black;
- }
- .buttonfont {
- font-family: "Trebuchet MS";
- font-size: 16px;
- }
- .hidelink {
- color: black;
- text-decoration: none;
- }
- </style>
- <center>
- <span style="font-family:Trebuchet MS"><h2>Login to Admin Panel</h2>
- </center>
- <span style="font-family:Trebuchet MS">
- <div class="border" style="margin-left: 45%; width: 20%; height: 120px;">
- <br>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="pwd">
- Password
- <table>
- <tr>
- <td><input name="passwd" type="password"/></td>
- </tr>
- <tr>
- <td align="center"><br/>
- <input type="submit" name="submit_pwd" value="Login"/>
- </td>
- </tr>
- </table>
- </form>
- </span>
- </div>
- </body>
- </html>
- <?php
- }
- ?>
- <?php
- $password = 'DTportal_20';
- if (isset($_POST['submit_pwd'])){
- $pass = isset($_POST['passwd']) ? $_POST['passwd'] : '';
- if ($pass != $password) {
- showForm("Wrong password");
- echo "<script type=\"text/javascript\">window.alert('Incorrect Password!');
- window.location.href = 'admin_panel.php';</script>";
- exit();
- }
- } else {
- showForm();
- exit();
- } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement