Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- ob_start();
- include ("config.php");
- ?>
- <html>
- <head>
- <title>Shitter ~ Share your shitty thoughts!</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
- <link href="style.css" rel="stylesheet" type="text/css"/>
- </head>
- <body>
- <div id="content" align="center">
- <center><img src="shitter.png" /></center><br>
- <?php
- if (! $logged[name]) {
- if ($_GET["action"] == "login") {
- $username = $_POST['username'];
- $password = sha1($_POST['password']);
- $info = mysql_query("SELECT * FROM users WHERE name = '$username'") or die(mysql_error());
- $data = mysql_fetch_array($info);
- if ($data[password] != $password) {
- echo "<meta http-equiv=\"refresh\" content=\"0; url=index.php?invalid=true\">";
- } else {
- $user = $data;
- setcookie("name", $user[name], time() + (11000), "/", "");
- setcookie("pass", $user[password], time() + (11000), "/", "");
- setcookie("id", $user[id], time() + (11000), "/", "");
- echo "<meta http-equiv=\"Refresh\" content=\"0; URL=dashboard.php\" />";
- }
- exit();
- } else {
- ?>
- <form method="post" action="?action=login" align="center">
- <b>Username:</b>
- <input type="text" value="" name="username"/><br>
- <b>Password:</b>
- <input type="password" value="" name="password"/>
- <div align="right"><input type="submit" onClick="javascript:submitForm()" value="Enter" name="submit"/></div>
- </form>
- <? if ($_GET[invalid] == "true"){ ?>
- <center>
- <font color="#ff0000"><strong>Warning:</strong> The userame and/or password you entered was incorrect</font><br>
- </center>
- <?php
- }
- if ($_GET[invalid] == "true"){
- echo ('
- <center><br>Forgotten your password? Contact site admins! <br /><br></center>
- ');
- }
- echo ('
- <center><b>Don\'t have an account?</b> <a href="register.php">Register here!</a></center>');
- if ($_GET[safelogout] == "true"){
- echo("<center><br><b>You have been successfully logged out!</b></center>");
- }
- }
- } else {
- header("Location: dashboard.php");
- }
- ?>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment