Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("db.php");
- session_start();
- if(isSet($_POST['username_log']) && isSet($_POST['password_log']))
- {
- // username and password sent from Form
- $nick=(mysqli_real_escape_string($conn,$_POST['username_log']));
- $username=sha1(mysqli_real_escape_string($conn,$_POST['username_log']));
- $password=sha1(mysqli_real_escape_string($conn,$_POST['password_log']));
- $result=mysqli_query($conn,"SELECT * FROM login_user WHERE username='$username' and password='$password'");
- $count=mysqli_num_rows($result);
- $row=mysqli_fetch_array($result,MYSQLI_ASSOC);
- // If result matched $myusername and $mypassword, table row must be 1 row
- if($count==1)
- {
- $_SESSION['login_user']=$row['username'];
- echo $row['username'];
- $_SESSION['nick_user']=$row['nick'];
- echo $row['username'];
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement