Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- [Censored mysql data]
- mysql_connect($mysql_host, $mysql_user, $mysql_password) or die ("Could not connect to mysql because ".mysql_error());
- mysql_select_db($mysql_database) or die ("Could not select database because ".mysql_error());
- $match = "select * from Users where username = '".$_POST['username']."' and password = '".$_POST['password']."';";
- $qry = mysql_query($match) or die ("Could not match data because ".mysql_error());
- $num_rows = mysql_num_rows($qry);
- if ($num_rows == 1) {
- $username = $_POST['username']
- setcookie("loggedin", "TRUE", time()+(3600 * 24));
- setcookie("mysite_username", "$username");
- Header("Location: User.php");
- }
- else
- {
- Header("Location: loginform.php");
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement