Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## login.php
- <?php
- session_start();
- // login?
- $pw = $_POST['password'];
- $name = $_POST['name'];
- $query = mysql_query("SELECT * FROM members WHERE username = ". $name ."' AND password = '". $pw ."'");
- $numrows = mysql_num_rows($query);
- if($numrows == 1) {
- $info = mysql_fetch_assoc($query);
- $_SESSION['username'] == $info['username'];
- header("Location: index.php");
- } else {
- header("Location: index.php?bad=1");
- }
- ?>
Add Comment
Please, Sign In to add comment