Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE and Session problem

Status
Not open for further replies.

overyde

Programmer
May 27, 2003
226
ZA
I have a shopping cart that utilises sessions. It works 100% perfectly in Firefox.

In I.E. when you click to place the item on order it simply says that there are no items in the shopping cart...why?

Reality is built on a foundation of dreams.
 
I checked and the session id is the same for both pages so it is something to do with the variables being passed.

Reality is built on a foundation of dreams.
 
ok...found out what was the cause but not why?

This works in Firefox but does not work in Internet Explorer:
Code:
<input type=\"image\" src=\"small_delete.gif\" value=\"delete\" name=\"delete\">

But this does:
Code:
<input type=\"submit\" value=\"delete\" name=\"delete\">

So you cant use an image for a submit button? Surely thats not the case?

Here is the argument for the process:
Code:
if($_POST[delete]) {
	$product = $_POST[id].$_POST[size];;
	$cart->del_item($_POST[id].$_POST[size]);
}

Reality is built on a foundation of dreams.
 
>>if($_POST[delete])

should be:
if($_POST["delete"])


and input type image must work correctly...

Known is handfull, Unknown is worldfull
 
I think that IE and Firefox return different information when a submit button is an image.

Dump the contents of the $_POST array when entering your script.
Code:
echo '<pre>';
print_r($_POST);
echo '</pre>';
should show you the differences, then you can change your code.

Ken
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top