Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $username="webuser";
- $password="";
- $database="assassin";
- //connection line
- $connected = mysql_connect(localhost,$username,$password);
- if (!$connected) {
- die('Could not connect: ' . mysql_error());
- }
- //selects database
- mysql_select_db($database, $connected) or die('Unable to select database: ' . $mysql_error());
- $codeid = $_POST['codeid'];
- $password = $_POST['password'];
- $query2 = "SELECT password FROM users WHERE codeid = '.$codeid';";
- $password_found = mysql_query($query2);
- $password_found = mysql_fetch_array($password_found);
- echo $password_found;
- if ($password_found == $password)
- {
- //user session info, UID
- $_SESSION['codeid'] = $codeid;
- header('Location: landing.html');
- }
- else
- {
- print "Incorrect user or password!";
- header('Location : index.html');
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement