Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $username = $_POST['username'];
- $password = $_POST['password'];
- //Hash password in a new variable
- $password2 = md5($password);
- require_once "/home/a7435766/public_html/scripts/dbconnect.php";
- $query = mysql_query("SELECT * FROM userstwo WHERE username = '$username' && password = '$password2'");
- if((mysql_num_rows($query)) != 0) {
- //Store username and password in a cookie
- if($_POST['remember'] == 'rememberme') {
- setcookie("username",$username,time()+3600*24*5,'','.ohjustthatguy.com');
- setcookie("password",$password,time()+3600*24*2,'','.ohjustthatguy.com');
- } else {
- setcookie("username","",time()-10,'','.ohjustthatguy.com');
- setcookie("password","",time()-10,'','.ohjustthatguy.com');
- }
- $_SESSION['username'] = $username;
- header('Location: http://www.ohjustthatguy.com/uploads/uploads.html');
- } else {
- header('Location: http://www.ohjustthatguy.com/uploads/');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement