Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $select = $con->prepare("SELECT * FROM users WHERE username='$username' and password='$password'");
- $select_>setFetchMode(PDO::FETCH_ASSOC);
- $select->execute();
- $data=$select->fetch();
- if($data['username']!=$username and $data['password']!=$password)
- {
- echo "invalid username or password";
- }
- elseif($data['username']=$username and $data['password']=$password)
- {
- $_SESSION['email']=$data['email'];
- $_SESSION['name']=$data['name'];
- header ("location:profile.php");
- }
- }
- }
- catch(PDOException $e)
- {
- echo "error".$e->getMessage();
- }
- <form name="myForm" method="post">
- <input type="text" placeholder="Type name & hit enter" name="email"><br><br>
- <input type="password" placeholder="Enter Password"name="password"><br><br>
- <input type="submit" value="SIGN IN" name="signin">
Add Comment
Please, Sign In to add comment