Re: PHP REDIRECT

From: Date: Mon, 16 Feb 2004 17:25:22 +0000
Subject: Re: PHP REDIRECT
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-177830@lists.php.net to get a copy of this message
> --- Chris <chris@leftbrained.org> wrote: >> You can't view the page and have PHP redirect it. You would need to >> use a <meta> refresh tag or JavaScript. > > I assume by meta refresh tag, you mean this: > > <meta http-equiv="refresh" > content="10;URL=http://example.org/"> > > What most people seem to not realize, is that the http-equiv attribute is > just a way to specify HTTP headers in a meta tag. This is handy when you > want to do so in static pages, but PHP has a more proper way to specify > headers: > > http://www.php.net/header > > This creates a real HTTP header, and there is no reason for any PHP > developer to use a meta tag for this purpose. Well, how about this situation as a reason: You must do authorization, then force a file download, and you want to also display a link to the file with the typical "click the link below if the download does not start automatically". I couldn't figure out how to display a page (after authorization), then use the PHP header redirect to force the download while keeping the same page display. However, using a meta refresh to a script that forced the download (without producing any display) was an easy solution. Am I overlooking a better solution? -- Lowell Allen

« previous php.general (#177830) next »