Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require("configuration.php");
- if(isset($_GET['login']))
- {
- $username = $_POST[username];
- $password = md5(sha1(md5(sha1($_POST[password]))));
- $db_info = mysql_query("SELECT * FROM `users` WHERE `username` = '$username'");
- $db_data = mysql_fetch_array($db_info);
- $check_db = mysql_num_rows($db_info);
- if($check_db == 0)
- {
- echo("Account not found in our database.");
- }
- else
- if($db_rdata[password] == $password)
- {
- $query = mysql_query("SELECT * FROM `users` WHERE `username` = '$username'");
- $user = mysql_fetch_array($query);
- $_SESSION['id'] = "$user[id]";
- $_SESSION['password'] = "$user[password]";
- echo("Loading Index...<meta http-equiv='refresh' content='1;url=main.php'>");
- }
- else
- {
- echo("Incorrect username or password!");
- }
- }
- else
- {
- echo("<form action='index.php?login' method='post'>
- <input type='text' name='username' /><br />
- <input type='password' name='password' /><br />
- <input type='submit' name='submit' value='Login' /><br />
- <br /><strong>Your IP will be logged ($_SERVER[REMOTE_ADDR])</strong>
- </form>");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement