Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- $serverneeded = false;
- require_once ("common/commonserver.php");
- session_start ();
- $success = false;
- if (isset ($_SESSION ['id']) && is_numeric ($_SESSION ['id']) &&
- isset ($_SESSION ['ip']) && ($_SESSION ['ip'] == $_SERVER ['REMOTE_ADDR']))
- {
- if (($level == 'admin') || ($level == 'tech'))
- header ("Location: admin/servers.php");
- else
- header ("Location: index.php");
- exit;
- }
- include "common/connectsql.php";
- if (isset ($_POST['email']) && isset ($_POST['pass']) &&
- isset ($_POST['Login']))
- {
- $user = stripslashes ($_POST['email']);
- $pass = stripslashes ($_POST['pass']);
- $result = mysql_query ("SELECT * FROM users ".
- "WHERE `email` = '".mysql_escape_string ($user)."' ".
- "AND `pass` = '".mysql_escape_string ($pass)."' ".
- "LIMIT 1");
- echo mysql_error();
- if ($result && mysql_num_rows ($result))
- {
- if ((mysql_result ($result, 0, 1) != "user") ||
- ((mysql_result ($result, 0, 1) == "user") &&
- (mysql_result ($result, 0, 2) != '')))
- {
- $_SESSION ['id'] = mysql_result ($result, 0, 0);
- $_SESSION ['user'] = $user;
- $_SESSION ['ip'] = $_SERVER ['REMOTE_ADDR'];
- $_SESSION ['level'] = mysql_result ($result, 0, 1);
- $_SESSION ['server'] = mysql_result ($result, 0, 2);
- header ("Location: index.php");
- $success = true;
- }
- }
- @mysql_free_result ($result);
- }
- if ($success)
- exit;
- ?>
- <html>
- <head>
- <title>Untitled Document</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
- <link href="stylesheet.css" rel="stylesheet" type="text/css">
- </head>
- <body>
- <table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
- <tr>
- <td><p><img src="images/logo.jpg" width="125" height="55"></p>
- <form method=POST action="">
- <p><strong>User Login:<br>
- </strong>Please enter your login info.</p>
- <p>Email:<br>
- <input name="email" type="text" class="txtfield" size="20">
- <br>
- Password:<br>
- <input name="pass" type="password" class="txtfield" size="20">
- <br>
- <input value="Login" name="Login" type="submit">
- </p>
- <p> <a href="forgotpass.php">Forgot Password?</a></p>
- </form>
- </td>
- </tr>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement