Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php include "config.php"; ?>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>NYPD Warrant syst.</title>
- <link rel="stylesheet" href="style.css" type="text/css" />
- </head>
- <body>
- <div id="main">
- <?php
- if(!empty($_SESSION['Loggedin']) && !empty($_SESSION['Username']))
- {
- ?>
- <h1> NYPD Warrant Area </h1>
- Thanks for logging in! You are: <?=$_SESSION['Username']?>
- <?php
- }
- elseif(!empty($_POST['username']) && !empty($_POST['password']))
- {
- $username = mysql_real_escape_string($_POST['username']);
- $password = md5(mysql_real_escape_string($_POST['password']));
- $verify = mysql_query("SELECT * FROM users WHERE username = '". $username."' AND password = '". $password. "'");
- if(mysql_num_rows($verify) == 1)
- {
- $row = mysql_fetch_array($verify);
- $_SESSION['Username'] = $username;
- $_SESSION['Loggedin'] = 1;
- echo "<h1> Login, Accepted </h1>";
- echo "<p>We are now redirecting you to the member area.</p>";
- echo "<meta http-equiv='refresh' content='=2;index.php' />";
- }
- else
- {
- echo "<h1>Oops, something went wrong!</h1>";
- }
- }
- else
- {
- ?>
- <h1>Member Login</h1>
- <p>Welcome! Please either login below, or <a href="register.php">click here to register</a>.</p>
- <form method="post" action="index.php" name="loginform" id="loginform">
- <fieldset>
- <label for="username">Username:</label><input type="text" name="username" id="username" /><br />
- <label for="password">Password:</label><input type="password" name="password" id="password" /><br />
- <input type="submit" name="login" id="login" value="Login" />
- </fieldset>
- </form>
- <?php
- }
- ?>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment