Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //ob
- ob_start();
- //session
- session_start();
- //connect
- $error = 'Could not connect to Database';
- mysql_connect('sql301.byethost33.com','b33_8897702','uwnwa101') or die($error);
- mysql_select_db('b33_8897702_serverscene') or die($error);
- //include functions
- require '../includes/functions.php';
- if ($_POST['login'])
- {
- //get form data
- $username = addslashes(strip_tags(strtolower($_POST['username'])));
- $password = addslashes(strip_tags($_POST['password']));
- if (!$username || !$password)
- echo "Please enter a username and password<p />";
- else
- {
- //find username, to check if it exists
- $find = mysql_query ("SELECT * FROM serverscene_users WHERE username_clean='$username'");
- if (mysql_num_rows($find)==0)
- echo "Username not found";
- else
- {
- while ($find_row = mysql_fetch_assoc($find))
- {
- //grab password hash for user
- $password_hash = $find_row['user_password'];
- }
- echo $password_hash;
- }
- }
- ?>
- <form action="login.php" method="POST">
- Username:<br />
- <input type="text" name="username"><p />
- Password:<br />
- <input type="password" name="password"><p />
- <input type="submit" name="login" value="Login"><p />
- </form>
Add Comment
Please, Sign In to add comment