Question:
Question about Microsoft Internet Explorer?
?
2009-12-16 09:19:07 UTC
I run a site and most of the users use Microsoft Internet Explorer. Recently the have sent E-mails to me saying that they are now unable to log in via the script I made. This script works fine on Mozilla Firefox and I have been told that it works on all other browsers except IE. Here is the code for logging in. Please don't comment about using cookies to store usernames.


include 'functions.php';

if (loggedin())
{
header("Location: userarea.php");
}

if ($_POST['login'])
{
$username = strip_tags($_POST['username']);
$password = strip_tags($_POST['password']);

if ($username&&$password)
{

$login = mysql_query("SELECT * FROM login WHERE username='$username'");
while ($row = mysql_fetch_assoc($login))
{
$db_password = $row['password'];
if (md5($password)==$db_password)
{
$loginok = TRUE;

}
else
$loginok = FALSE;

if ($loginok==TRUE)
{


setcookie("username",$username, time()+172800);
header("Location: userarea.php");
$admin = $row['admin'];
if ($admin==1) {
setcookie("admin",$username, time()+172800);
}


}

if ($loginok=="FALSE")
{
echo "Incorrect username or password.";
}

}

}
else
echo "Please enter a username and password.";


}

?>


I have looked over this code many times and I haven't really noticed anything wrong. Does anyone see something I don't or is this just an issue with IE?
Thanks.
Three answers:
tom ridle
2009-12-16 09:25:37 UTC
Code is perfect, and good logic..... its a fault with IE.



you may be able to correct it using sessions instead of cookies (sorry but IE is crazy).



and please put up a label asking users to switch to firefox or something.

ever thought why people are moving away from IE..this is why.
gurnam
2016-11-14 04:04:00 UTC
Microsoft internet Explorer 7 is meant to be greater shield and has the ability to filter out phishing websites, although in case you do unlike countless of Microsoft internet browsers you ought to attempt downloading for loose Mozilla's Firefox internet browser.
Pfo
2009-12-16 10:23:38 UTC
This is all PHP server side code, it's irrelevant to the discussion of browsers, regardless of what browser they use the same server side code executes the same. Check any javascripts or things you have in the client side code, that's where the problem is likely to be.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...