Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $username = $_POST['username'];
- $password = $_POST['password'];
- if ($username&&$password)
- {
- $connect = mysql_connect("mysql.freezoka.net","u436088065_helge ","toribash123") or die(mysql_error());
- mysql_select_db("u436088065_phplogin") or die(mysql_error());
- $query = mysql_query("SELECT * FROM users WHERE username='$username'");
- $numrows = mysql_num_rows($query);
- if ($numrows!=0)
- {
- // code for login
- while ($row = mysql_fetch_assoc($query))
- {
- $dbusername = $row['username'];
- $dbpassword = $row['password'];
- }
- // Check to see if password match with the one in the database.
- if ($username==$dbusername&&$password==$dbpassword)
- {
- echo "Login Successfull!<br /> <a href='member.php'>Click Here</a> to enter the member page";
- $_SESSION['username'] == $dbusername;
- } else {
- echo "Incorrect Password!"; }
- } else {
- die("User: <b>$username</b> does not exist");
- }
- }
- else
- die("Please enter a Username & Password");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement