Jump to content

[SOLVED] PHP code - WORK with Firefox, sometimes don't with IE


ltrem

Recommended Posts

Good morning guys,

 

I cannot really show you the code I use since it's kind of elaborate but my main question is this :

 

Does anybody know why would some PHP code would work with Firefox (ALL THE TIME) and the same code doesn't work ALL THE TIME (sometimes it work) with Internet Explorer 7 ?

 

I was thinking the only problems IE vs Firefox would be on the client side... with the HTML and CSS...??

 

What could be wrong?

I think it might be a sessions related problems.

 

On my site, I have many "category" of different product. The user can subscribe to a product to receive email when new product is there.

 

With Firefox, the user can navigate and subscribe to any category without problems, the INSERT/UPDATE are done correctly in the Database.

 

However, with Internet Explorer, the user can only subscribe to ONE category. Each time he tries to subscribe to another, the code is executed as it worked (it return a message that he his subscribed) but the INSERT/UPDATE are NOT done in the Database. The user have to CLOSE the Window of IE, re-open it, go the the page again and subscribe, that will work. Over 1 subscribe doesn't work, IE have to be restarted for it to work again..... I don't understand.

 

Weird.... work #1 with firefox and not with IE... that is not HTML/CSS related......

It sounds like the HTML of your form is invalid and the data is not being sent.

 

Have you displayed all the form data once it reaches the server to know if you are getting the correct data from the browser?

echo "<pre>";
echo "GET:";
print_r($_GET);
echo "POST:";
print_r($_POST);
echo "</pre>";

 

Alright! Thanks,

 

I figured out one of my variable from the Sessions Array isn't updating from page to page in IE... but it does in Firefox.. WTH ! I hate IE... :(

If only one session variable is not working in IE, but other session variables do work in IE, that means either that session variable is not being set or it is being overwritten. About the only two things that could cause that are if an image is being used as a submit button and/or register_globals are on and you have some other variable with the same name that IS being providing when IE requests a page but is not being sent by FF when it requests a page.

I found the error... well a Co-Worker found it but here it is :

 

The thing I forgot to mention is that the INSERT query is executed via a php script that is called by a AJAX function. With Internet Explorer, the first click CACHE the sessions and each time the script URL is called with the AJAX, it take the cached array.

 

I solved that problems by adding a parameter "random". I randomise a number so that each other click have a different "random" than the last one! This way it doesn't take the cache since  the URL is different.

 

I still thank you ALOT for your help!

Archived

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

×
×
  • Create New...

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.