Page 1 of 1

questoin on headers (they're sent ok, i just need to modify)

Posted: Sun Aug 31, 2003 6:25 pm
by m3rajk
ok. this isn't covered [url=http://us3.php.net/manual/en/function.header.php]here, and i'm about to check the header thread, but i doubt it's there... witht he redirection header, is there a way to specify how long until redirection? i need to delay it so that if there's an error message the user can read it, because there's an issue and the redirection is moving to fast... i don't see the debugging lines i placed in

Posted: Sun Aug 31, 2003 6:37 pm
by JAM
Think not...
But you could perhaps any debugging message as a ?error=message and retrieve it with a $_GET in the taget file (assumes you are Location: to one of your own pages).

If error occurs, logging it to a simple *.txt file might help also, displaying it later?

If error occurs, halt the page totally, displaying the errormsg, and a link to the Location: page (letting the user click the link after he/she reads the message...)

Just ideas.

Posted: Sun Aug 31, 2003 6:42 pm
by McGruff
This board does this when you post a message. Haven't looked at the code but I'm betting it's js.

Posted: Sun Aug 31, 2003 7:04 pm
by neil6179
This can be done using a meta tag rather than using the header function as below:

Code: Select all

<meta HTTP-EQUIV="REFRESH" CONTENT="3; URL=http://www.google.com">

<?php

        Print "Error message";

?>
This will redirect you to that page you set after a delay of 3 seconds.
I've jsut tried the code above and I am redirected to google after 3 seconds and whilst I am waiting I get "Error Message" on my page.

Is this any help??

Just for interest sake, something I found very handy for pages that need refreshing alot (e.g real time stats) you can use

Code: Select all

<meta HTTP-EQUIV="REFRESH" CONTENT="60">
which will refresh the current page every 60 seconds, thus keeping it up tp date!

N...

Posted: Sun Aug 31, 2003 7:46 pm
by m3rajk
neil: i know the meta tag, thing is i use a function that's specifically for setting the begining of each page, i already haveone to send people home if an error occurs, one for frames, and one for the rest of he pags, i don't feel like coding yet another one