Jump to content

Archived

This topic is now archived and is closed to further replies.

Timmeh

Woe is me - IE vs Firefox session

Recommended Posts

First of all, I apologise for starting a thread about sessions. I did read through the troubleshooting guide, but I couldn't find a solution for my problem.

I have written my own software for my club site, where members can login in to change their details and update photos. My software works 100% fine in Firefox, but in Internet Explorer it has issues when logging in, which is what I don't understand.

It seemed to even work on Internet Explorer when I asked a couple people to try it when random club members had problems with it, and now it won't even work on IE on my machine (though I use Firefox normally so I didn't realise I had a problem).

The login code is as follows:


<?php // login.php
session_start();
require_once('functions.php');

if (isset($_POST['UserName']) && isset($_POST['Passwd']))
{
$UserName = $_POST['UserName']; // if the user has just tried to log in
$Passwd = $_POST['Passwd'];

$db_conn = db_connect();
if (!$db_conn)
{
// log them out if there's no database
echo 'Could not connect to server database - please try again later.';
end_session();
}
else
{
$query = 'SELECT * FROM members WHERE ffname="'.$UserName.'" AND pwd="'.$Passwd.'";';
$result = mysql_query($query, $db_conn);
if ($result && (mysql_num_rows($result) == 1))
{
// they are in the database so register the user id
$_SESSION['valid_user'] = $UserName;
if ($UserName == "zzedmin")
header("Location:./admin.php");
else
header("Location:./change.php");
}
else
header("Location:./logout.php");
}
}

if (!isset($_SESSION['valid_user']))
{ ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head><title>European Ford Owners Club of Australia</title>
<style type="text/css">
<!--
a:link {color:#FFFFFF}
a:visited {color:#FFFFFF}
a:hover {color:#FF0000}
a:active {color:#FF0000}
-->
</style>
</head>
<body bgcolor="#647FC2" onLoad="document.thisForm.UserName.focus();">
<font face="Arial, Helvetica, sans-serif" size="3">
<font color="#993300"><h2>This area is reserved for members only
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="view.php">Go Back</a></h2></font>
<br>
<h4>Please enter your Login Name and Password</h4>
<form action="<?php $PHP_SELF ?>" method="post" name="thisForm">
<table border="0" cellpadding="2" cellspacing="2">

<tr>
<td width="150" align="right">Login Name</td>
<td width="250"><input type="text" name="UserName" size="25" maxlength="20"></td>
</tr>

<tr>
<td align="right">Password</td>
<td><input type="password" name="Passwd" size="10" maxlength="8"></td>
</tr>

<tr>
<td align="right">&nbsp;</td>
<td align="right"><input type="submit" value="Log in"></td>
</tr>
</table></form>
<?php
}

echo '</body></html>';
?>



Where do I start looking for a problem that doesn't appear in Firefox, but does in Internet Explorer?

I'm reading up as many troubleshooting guides as I can to learn more about php, but feel like I am getting nowhere fast. Any help would be appreciated.

Tim

Share this post


Link to post
Share on other sites
[!--quoteo(post=362078:date=Apr 5 2006, 06:42 PM:name=MrLeN)--][div class=\'quotetop\']QUOTE(MrLeN @ Apr 5 2006, 06:42 PM) [snapback]362078[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Personally, I think it's your IE settings.

MrLeN
[/quote]
We thought so to, so we went through every single IE setting we could find to make it work. It must be every single persons IE settings now though if it is a settings issue, because it won't work on anyone's machine with IE, only Firefox.

If it is an IE setting issue, what sort of settings need to be changed? I have tried changing the settings to allow every single site in the world to work but it still won't, so I'm a little stumped.

I guess the best question to ask would be, how can I change my code so that people don't need to change their IE settings (if it is an IE setting problem)?

Tim

Share this post


Link to post
Share on other sites
Ok, then I think you have to check that a cookie hasn't already been set. Dump your cookies.

MrLeN

Share this post


Link to post
Share on other sites
[!--quoteo(post=362081:date=Apr 5 2006, 06:52 PM:name=MrLeN)--][div class=\'quotetop\']QUOTE(MrLeN @ Apr 5 2006, 06:52 PM) [snapback]362081[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Ok, then I think you have to check that a cookie hasn't already been set. Dump your cookies.

MrLeN
[/quote]
Thanks for the reply again.

Yeah, I did previously try it, and just tried it again, still no joy. I appreciate your suggestions, just can't work out what is not working for us.

Tim

Share this post


Link to post
Share on other sites
Snap your keyboard over you knee and throw your coffee mug at a hard wall.

Then set your hair on fire and punch yourself in the face.

MrLeN

Share this post


Link to post
Share on other sites
[!--quoteo(post=362085:date=Apr 5 2006, 07:09 PM:name=MrLeN)--][div class=\'quotetop\']QUOTE(MrLeN @ Apr 5 2006, 07:09 PM) [snapback]362085[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Snap your keyboard over you knee and throw your coffee mug at a hard wall.

Then set your hair on fire and punch yourself in the face.

MrLeN
[/quote]
It's worth a shot

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.