Hi David,
Your question has seen much debate in this newsgroup. I had much the same
problem and solved it by writing the following function:
/**
* wrapper for header( "Location: url" )
*/
function redirect( $url, $showMoved=false ) {
// set refresh to target $url
header( "Refresh: 0; url=$url" ) ;
// show page has moved
if ( $showMoved ) {
echo "<html><head><title>Moved to $url</title></head><body><p>This page
has moved to <a href=\"$url\">$url</a>.</body></html>" ;
}
// exit current script
exit ;
}
Since it doesn't use header( "Location: ..." ) you are able to write your
cookies before you redirect. It's about the most elegant solution to your
problem, short of redesigning your pages. Of course, I have noticed that if
you don't supply the html ($showMoved) Opera chokes. IE and Netscape seem to
handle it fine and I haven't tested Mozilla yet.
Hope it helps!
Cord
"David Busby" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> List,
> I'm trying to set a cookie like this:
> <?php
> function redirect() {
[..snip..]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php