Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start(); //Start the session
- use Ct\Ct\Data\Data;
- $error = false;
- if (isset($_POST['submit'])) {
- $username = filter_input(INPUT_POST, 'username');
- $password = filter_input(INPUT_POST, 'password');
- $accounts = Data::getpassword();
- foreach ($accounts as $account) {
- if ($username == $account->user_name && $password == $account->user_pass) {
- session_regenerate_id(true);
- $_SESSION['usr'] = $account->user_name;
- header("Location: admin-gunpage-update/");
- die();
- }
- }
- $error = true;
- }
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>Login Gun Page Update</title>
- <link rel="stylesheet" href="style.css">
- <style>
- .error {
- color:red;
- position: relative;
- left: -27%;
- }
- </style>
- </head>
- <body>
- <?php if ($error): ?>
- <center><b class="error">Invalid username or password, please check again! </b></center>
- <?php endif; ?>
- <form name="login" id="login" method="POST" action="">
- <label class="log_in"> LOGIN </label>
- <p><label for="username" class="username">Username: </label><input type="text" size="100" name="username" id="username" value="" placeholder="UserName"/></p>
- <p><label for="password" class="password">Password: </label><input type="password" size="40" name="password" id="password" value="" placeholder="Password"/></p>
- <p><input type="submit" name="submit" id="submit" class="submit" value="Submit"/> <input type="reset" name="reset" id="reset" class="reset" value="reset"/></p>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement