i changed the places required and my code now looks like these:
Further more its got an error e-Parse error: syntax error, unexpected T_ELSE in checklogin.php on line 48
just to test it i have taken that bit out and same thing seems to happen from my login.php file when i enter a username and password it just takes me to blank page with /checklogin.php which is this page
- <?php
- session_start();
- $username = $_POST['username'];
- $password = $_POST['password'];
- if (isset($_POST['submit']))
- {
- if(empty($username) || empty($password))
- {
- die("Fill in all fields");
- }else {
- $connect = mysql_connect("**","**","**") or die("Could not connect");
- mysql_select_db("uad0905525") or die ("could not connect");
- $query = mysql_query("SELECT password FROM customer WHERE username='$username'");
- $numrows = mysql_num_rows($query);
- echo $numrows;
- if ($numrows!=0)
- {
- $row = mysql_fetch_assoc($query);
- $dbusername = $row['username'];
- $dbpassword = $row['password'];
- if ($username==$dbusername&&$password==$dbpassword)
- {
- echo "Welcome, <a href='login_sucess.php'>Click</a> here to enter Website";
- $_SESSION['username']=$username;
- }
- else
- {
- echo "Incorrect password";
- }
- }
- else
- die ("That user doesn't exist!");
- }
- else -----line 48
- die ("Please enter username and password");
- }
- ?>

