strange header location error

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

Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Post by Gen-ik »

JAM wrote:The IE6 bug is about messages as "Want to refresh data" and it's likes when presing the back button after submitting a form (as well as issues saving the forms entered data while doing the same).
Yes, might work for you, but you are perhaps 2% of the IE users not affected, so i'd still recommend using it along with other no-caching headers. It's not vital to get things to work, it merely removes certain unwanted sideeffects.
Nice to know I'm special :D

Anyways... if I'm to start using the IE6 Fix is it only needed for pages that contain no browser data (ie nothing gets echoed or printed to the screen) and contains a header("Location") call... or should it be on all pages (surely you don't want to put no-caching on all all pages)?
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

I think he needs to call session_write_close() before the header location function.
kumarsena
Forum Newbie
Posts: 18
Joined: Mon Oct 20, 2003 7:18 am
Contact:

Post by kumarsena »

well, tested now and the session is being set. no doubt....
kumarsena
Forum Newbie
Posts: 18
Joined: Mon Oct 20, 2003 7:18 am
Contact:

Post by kumarsena »

u guys know what? i might just be the biggest idiot on the planet....
kumarsena
Forum Newbie
Posts: 18
Joined: Mon Oct 20, 2003 7:18 am
Contact:

Post by kumarsena »

i had made changes to the local verison of the site, and had moved skins into a new folder.....guess what...i forgot to upload this folder to the server,, so there was a reference to a non-exsisting folder.....thats why the whole problem...the thing is now...if i use

header("Location: welcome.php3");

it works fine...no probs at all, but if i use

header("Location: http://www.domain.tk/welcome.php3");

then it reloads the index page aagain...

i had tried just the first option but since the skin wasnt loading i figured the session wasnt maybe set.....

but anyway just wondering,,,,why the reload, when using full url?


anyways.....thanks for all the help

kumar
User avatar
Pyrite
Forum Regular
Posts: 769
Joined: Tue Sep 23, 2003 11:07 pm
Location: The Republic of Texas
Contact:

Post by Pyrite »

Read the manual page for the header() function. It explains the difference between calling a file on the server filesystem and using a URL.

http://www.php.net/header
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

Gen-ik wrote:
JAM wrote:The IE6 bug is about messages as "Want to refresh data" and it's likes when presing the back button after submitting a form (as well as issues saving the forms entered data while doing the same).
Yes, might work for you, but you are perhaps 2% of the IE users not affected, so i'd still recommend using it along with other no-caching headers. It's not vital to get things to work, it merely removes certain unwanted sideeffects.
Nice to know I'm special :D

Anyways... if I'm to start using the IE6 Fix is it only needed for pages that contain no browser data (ie nothing gets echoed or printed to the screen) and contains a header("Location") call... or should it be on all pages (surely you don't want to put no-caching on all all pages)?
Do not take me wrong. It's an annoying bug imho. It is clientside so the results varies from viewer to viewer, but the good thing is that the simple header() fixes it.

If you would use it, you would prefer using it whenever there is $_POST involved. I personally disable caching on all my pages, for two reasons.

a) I write mainly dynamic data. I don't want it cached (exception when making image-galleries etc.) You have the option to change the time before cahcing expire so that is something worth using so that the pages are not entirely, non-cached (if that made sence ;)).

b) You are not disabling the cache on the end user only, but also on various proxies that might be passed through on the way. If you press F5 to update the page, but recieve the page from a cahced proxy, what use does it have if it's an older copy?

I'm not to fluent in how proxies work and if this really is 'the way' to do it, and further discussion should be opened in another Therot thread.

@kumarsena:
;) Glad you worked that part out. I know the feeling...
If Pyrites header() instruction didn't give you anything, post some code. I tested similiar code, and it worked here so it's hard telling where the error lies.
Post Reply