session variables, cache and (mac) Internet Explorer 5.2

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kpegram
Forum Newbie
Posts: 6
Joined: Wed Apr 14, 2004 12:03 pm

session variables, cache and (mac) Internet Explorer 5.2

Post by kpegram »

Hi,
To be able to repopulate form fields when a person uses the back arrow, I'm using session variables. For (mac) IE 5.2, even though the session variables have the correct values and the html source code has correct values and syntax (ie checkboxes checked) the front-end HTML is incorrect. Even refreshing the browser multiple times, the code doesn't show up correctly. The code works on (mac) netscape 7.1.

I'm not certain, but I thought this might have something to do with cache, so I tried adding different headers to my script:

<?
session_start();

Header("Cache-control: private, no-cache");
Header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); # Past date
Header("Pragma: no-cache");

This didn't help! Can you help?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Does the HTML look incorrect, or is the source code incorrect?
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
kpegram
Forum Newbie
Posts: 6
Joined: Wed Apr 14, 2004 12:03 pm

Post by kpegram »

Thanks for your response. Actually, they're both correct. What's happening is when you look at view source from the browser, the HTML code for the checkbox is correctly generated using the session variables, but when you look at the generated web page it's appearing differently (ie a checkbox that should be checked isn't and vice versa).

To verify the HTML was correct, I copied the checkbox code from view source into a new document and it appeared the way it should have... What's wierd is that this is working in (mac OSX) Netscape, but not in IE!
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

So..... the code that you see when you view source in IE, doesn't match up with what is actually being displayed. This only happens in IE, and not in Netscape. Sorry if it's taking me a while to understand, but this seems really messed up.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
kpegram
Forum Newbie
Posts: 6
Joined: Wed Apr 14, 2004 12:03 pm

Post by kpegram »

I agree! That's why I was thinking it might have something to do with cache??
kpegram
Forum Newbie
Posts: 6
Joined: Wed Apr 14, 2004 12:03 pm

Post by kpegram »

sorry, I forgot to mention, the code is doing what you say.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

I assume you've emptied the cache and all? I've noticed sometimes with IE, you have to catch it acting up before it'll actually admit it. Try removing the page entirely and go to it's address. Then IE should pop up a 404 error. Empty your cache before and after you do this. When you're done, put the page back, visit it and see what happens.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
kpegram
Forum Newbie
Posts: 6
Joined: Wed Apr 14, 2004 12:03 pm

Post by kpegram »

Yes, I had emptied the cache. I tried your suggestion and got the 404 error, emptying cache before and after. I put the page back and I still get the same results. :?
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Well, after all that discussion, I don't know what to say. Does the source from IE and Netscape match up? I have a pretty big hatred for IE on Mac. It was never supported well and is a shoddy product. It's entirely possible that this is just something that cannot be fixed from your side (although I hate saying that). One other thing would be to double, triple, and quadruple check the source code against the page. Maybe output some flags to make sure you're matching up the right section of code with the right area on the page. Beyond that I'm not really sure what to do here.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
kpegram
Forum Newbie
Posts: 6
Joined: Wed Apr 14, 2004 12:03 pm

Post by kpegram »

I'll do some source checking to see if I can pinpoint anything. I'll let you know if by some chance I get it working on Mac IE... Thanks for all your help, pickle!
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

Try it on other Mac browsers - Camino, iCab, Omniweb, and Safari and see what they do. Camino and Safari uses the same Gecko core as Mozilla and Firefox, but as far as I know, iCab and Omniweb are their own. They might show something interesting.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply