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

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
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

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

Post 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
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post 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.
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

This board does this when you post a message. Haven't looked at the code but I'm betting it's js.
neil6179
Forum Newbie
Posts: 3
Joined: Wed Jul 09, 2003 5:05 pm

Post 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...
m3rajk
DevNet Resident
Posts: 1191
Joined: Mon Jun 02, 2003 3:37 pm

Post 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
Post Reply