almightyegg Posted November 19, 2006 Share Posted November 19, 2006 it works fine in IE, but not in FireFox :-[[b]Welcome page:[/b][code=php:0]<? session_start(); // Session Start include 'db.php'; // Connect to DB session_register('email'); session_register('password'); $email = $_POST['email']; $password = $_POST['password'];if((!$email) || (!$password)){ echo "Please enter ALL of the information! <br />"; include 'index.php'; exit(); } if((!$email) || (!$password)){ echo "Please enter ALL of the information! <br />"; echo "<a href=\"index.php\" />Click here to return to the main page</a>"; exit(); } $sql = mysql_query("SELECT * FROM users WHERE email='$email' AND password='$password' AND activated='1'"); $login_check = mysql_num_rows($sql); if($login_check == 0){ $sql1 = mysql_query("SELECT * FROM users WHERE email='$email'"); $sql2 = mysql_query("SELECT * FROM users WHERE email='$email' AND password='$password'"); $sql3 = mysql_query("SELECT * FROM users WHERE email='$email' AND password='$password' AND activated='1'"); $c1 = mysql_num_rows($sql1); $c2 = mysql_num_rows($sql2); $c3 = mysql_num_rows($sql3); echo "The following errors were found from your login.<br>"; if($c1==0){ echo "The email you've entered was not valid. Please go back and <a href=\"welcome.php\" />try again</a>."; }elseif($c2==0){ echo "The password you've entered was incorrect. Please go back and <a href=\"welcome.php\" />try again</a>. If you would like your password sent to you via email please <a href=\"lostpw.php\" />click here</a>"; }elseif($c3==0){ echo "You did not yet validate your account! If you would like your validation code sent to you via email please <a href=\"resend.php\" />click here</a>."; } }else{ //page goes here}[/code][b]All other pages:[/b][code=php:0]<?session_start(); // Session Startinclude 'db.php'; // Connect to DB$email = $_SESSION['email']; $password = $_SESSION['password']; if((!$email) || (!$password)){ echo "Please enter ALL of the information! <br />"; include 'index.php'; exit(); } if((!$email) || (!$password)){ echo "Please enter ALL of the information! <br />";echo '<a href=index.html>Click here to return to the main page</a>';exit(); } $sql = mysql_query("SELECT * FROM users WHERE email='$email' AND password='$password' AND activated='1'"); $login_check = mysql_num_rows($sql); if($login_check == 0){$sql1 = mysql_query("SELECT * FROM users WHERE email='$email'");$sql2 = mysql_query("SELECT * FROM users WHERE email='$email' AND password='$password'");$sql3 = mysql_query("SELECT * FROM users WHERE email='$email' AND password='$password' AND activated='1'");$c1 = mysql_num_rows($sql1); $c2 = mysql_num_rows($sql2); $c3 = mysql_num_rows($sql3);echo"The following errors were found from your login.<br>";if($c1==0){echo"The email you've entered was not valid. Please go back and <a href=index.php>try again</a>.";}elseif($c2==0){echo"The password you've entered was incorrect. Please go back and <a href=index.php>try again</a>. If you would like your password sent to you via email please <a href=lostpw.php>click here</a>";}elseif($c3==0){echo"You did not yet validate your account! If you would like your validation code sent to you via email please <a href=resend.php>click here</a>.";}}else{//page goes here}[/code] Quote Link to comment Share on other sites More sharing options...
printf Posted November 19, 2006 Share Posted November 19, 2006 What doesn't work, please explain the exact problem.printf Quote Link to comment Share on other sites More sharing options...
AndyB Posted November 19, 2006 Share Posted November 19, 2006 [quote]it works fine in IE, but not in FireFox[/quote]Then I'd guess it's an html issue not a php issue. Possibly a badly-coded form. Quote Link to comment Share on other sites More sharing options...
almightyegg Posted November 19, 2006 Author Share Posted November 19, 2006 well, to be precise, you can login in FF but then you cant go to any pages...it just shows the login form again and says, please enter all the infomation.... Quote Link to comment Share on other sites More sharing options...
almightyegg Posted November 19, 2006 Author Share Posted November 19, 2006 Oh, and here is my form...[code]<center><fieldset><legend>Login</legend><table border=0 cellpadding=10><tr><td valign=center><form method=POST action=welcome.php name=form1>Email:<br> <input type=text name=email><bR><br>Password:<br> <input type=password name=password><br><br><input type=submit value=Login!></form></td></tr></table></fieldset></center>[/code] Quote Link to comment Share on other sites More sharing options...
emehrkay Posted November 19, 2006 Share Posted November 19, 2006 for - one just reading over your code - you give the user WAY too much info about the username password combo. Just say "Somehting is off with eiter your un or pw" if i were a hacker and seen that i had the correct username but not the right password, i could create a bot that would brute force its way in. Quote Link to comment Share on other sites More sharing options...
AndyB Posted November 19, 2006 Share Posted November 19, 2006 Just so we can remove one possible problem, please use (something like) this as your log-in. Halfway decent html never hurt anyone :)[code]<center><fieldset><legend>Login</legend><table border="0" cellpadding="10"><tr><td valign="center"><form method="post" action="welcome.php" name="form1">Email:<br><input type="text" name="email"><br><br>Password:<br><input type="password" name="password"><br><br><input type="submit" value="Login!"></form></td></tr></table></fieldset></center>[/code] Quote Link to comment Share on other sites More sharing options...
almightyegg Posted November 19, 2006 Author Share Posted November 19, 2006 didnt change anything :-[and yes i agree with emehrkay, it does have too much info....I will sort that out later... Quote Link to comment Share on other sites More sharing options...
almightyegg Posted November 20, 2006 Author Share Posted November 20, 2006 right...this is very odd...I made no changes since yesterday, and now it is working :-\ there must be something iffy going on ??? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.