PHP-Problems trying to read a cookie in IE

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
User avatar
LegionPete
Forum Newbie
Posts: 7
Joined: Wed Dec 31, 2003 3:36 pm

PHP-Problems trying to read a cookie in IE

Post by LegionPete »

I'm tying to read a cookie in IE. The problem is, that I must manually refresh the page after the page has already been loaded once. I though maybe it was pulling from a cahced page, but when I clear my cache and my cookies, it still holds the old value until I click the refresh option.

http://www.joycemeyer.org/cgi-bin/msoft ... st&CARTID=

here is the link. Click on the text prefs just to see how it runs. When you try to access it a second time, after you've submited it once, It is suppose to look up the new cookie value, and start there. Instead, It will default to a previous number. Say, If it was 0 when you started, when you return, it will still be 0 until you refresh. Can you help?
User avatar
LegionPete
Forum Newbie
Posts: 7
Joined: Wed Dec 31, 2003 3:36 pm

Post by LegionPete »

I guess the real question is, why isn't it reading my cookie read the first time?
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

Because..a page MUST refresh to read the cookies. This is because PHP is a server side language. What I would suggest is this line after writing the cookie.

Code: Select all

<meta http-equiv="REFRESH" content=".1;URL=http://eckclan.sytes.net">
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Or use [php_man]header[/php_man]()'s to forward the users.
User avatar
LegionPete
Forum Newbie
Posts: 7
Joined: Wed Dec 31, 2003 3:36 pm

It works!

Post by LegionPete »

Actually, it seems that the server was dealing out a cached page....not really sure why. Anyway, thanks for the help this has be solved.
Post Reply