Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST['username'], $_POST['password']))
- {
- if(get_magic_quotes_gpc())
- {
- $ousername = stripslashes($_POST['username']);
- $username = mysqli_real_escape_string(stripslashes($conn, $_POST['username']));
- $password = stripslashes($_POST['password']);
- }
- else
- {
- $username = mysqli_real_escape_string($conn, $_POST['username']);
- $password = $_POST['password'];
- }
- $sql = ('SELECT password,id from users where username='.$username.'');
- $result = mysqli_query($conn, $sql);
- $dn = mysqli_fetch_array($result);
- if($dn['password']==sha1($password) and mysql_num_rows($sql)>0)
- {
- $form = false;
- $_SESSION['username'] = $_POST['username'];
- $_SESSION['userid'] = $dn['id'];
- if(isset($_POST['memorize']) and $_POST['memorize']=='yes')
- {
- $one_year = time()+(60*60*24*365);
- setcookie('username', $_POST['username'], $one_year);
- setcookie('password', sha1($password), $one_year);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement