Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($_POST["user"]) && isset($_POST["pass"]))
- {
- $message = "Login incorrect.";
- $connection = mysql_connect("localhost","root","");
- $user = $_POST["user"];
- $pass = $_POST["pass"];
- mysql_select_db("mystnews", $connection);
- $result = mysql_query("SELECT * FROM members WHERE user='$user'");
- if($row = mysql_fetch_array($result))
- {
- if($row["pass"] == $pass)
- {
- header("Set-Cookie: username=$user; httpOnly");
- $message = "Successfully logged in as $user, you will be redirected automatically.";
- }
- }
- }
Add Comment
Please, Sign In to add comment