Advertisement
Guest User

Untitled

a guest
Sep 18th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2.  
  3. session_start();
  4.  
  5. include_once "template.php";
  6. include_once "inc/database.php";
  7.  
  8. $username = $_POST["username"];
  9. $password = $_POST["password"];
  10.  
  11. $sql = "SELECT username FROM users WHERE username='$username' AND password='$password'";
  12. $query = mysql_query($sql);
  13. if (mysql_num_rows($query)) {
  14. echo "Thanks for logining in! <a href='index.php'>Return to index</a>";
  15. } else {
  16. echo "Looks like you have entered unvalid information, please try again";
  17. while($query ->$sql) {
  18. $_SESSION['id'] = $row['id'];
  19. $_SESSION['username'] = $row['username'];
  20. $_SESSION['email'] = $row['email'];
  21.  
  22. }
  23. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement