Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include_once "template.php";
- include_once "inc/database.php";
- $username = $_POST["username"];
- $password = $_POST["password"];
- $sql = "SELECT username FROM users WHERE username='$username' AND password='$password'";
- $query = mysql_query($sql);
- if (mysql_num_rows($query)) {
- echo "Thanks for logining in! <a href='index.php'>Return to index</a>";
- } else {
- echo "Looks like you have entered unvalid information, please try again";
- while($query ->$sql) {
- $_SESSION['id'] = $row['id'];
- $_SESSION['username'] = $row['username'];
- $_SESSION['email'] = $row['email'];
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement