php problem with IE (possibly session related)

Soldato
Joined
13 Dec 2002
Posts
7,646
Location
Manchester City Centre
i've got two problems with a simple e-shop that i've written the code for
i think they may boil down to being the same problem but i'm not sure:

1st up:

simple login:
just takes a user id as input, checks against the db and forwards to the correct page if it exists

works for firefox but not for IE - if you press Enter to submit the form (if you click the login-submit button it works as in firefox)


2nd:

shopping basket:
the fundamental part that isnt working is the creation of a session variable which is called later in the page
code as below:
PHP:
$result = mysql_query($query);
$thisorder = mysql_insert_id();
}
if ((!isset($_SESSION['order'])) || ($_SESSION['order'] == NULL))
{
$_SESSION['order'] = $thisorder;
}
as with the login it works fine in FF but not in IE.

I will keep putting debug echos in to try and find where it's going wrong, but kind of desperate to solve this, i've been testing throughout dev in FF unaware there could be any incompatibilities like these
any suggestions will be gratefully appreciated
 
on further investigation the 2nd one isnt because of that bit of code, was further up the tree than i thought
Code:
if(isset($_POST['update']) || isset($_POST['submit']))
that's the bit that's actually causing the problem
and i've an inkling it may be to do with the submit button on the previous page being an image
Code:
<input name="submit" type="image" src="images/next.gif" alt="Submit Button" value="Order">
just looking into whether there's a known problem with submitting a form like that in IE
 
dont think it can be as a result of that ^ as it seems to work fine on other forms throughout the site, but this is the only time i check for $_POST['submit']

edit: just frigged about with it and it looks like that was the problem
have worked round it by setting a session variable on the 1st page and checking for that rather than the submit button

still stumped by the login click but not enter jobbie though :(
 
Back
Top Bottom