Hi all,
Can someone tell me the function to redirect a browser to a specific page?
Johnny
For example:
?
code...
code...
code finished.
redirect(http://www.domain.com/admin.php;);
?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
header(Location: http://www.domain.com/admin.php;);
if you _really_ need to use your syntax, you could
function redirect($uri) { header(Location: .$uri); }
On Friday 28 March 2003 03:28 pm, Johnny Martinez wrote:
Hi all,
Can someone tell me the
header(Location: http://php.net/header;);
Johnny Martinez wrote:
Hi all,
Can someone tell me the function to redirect a browser to a specific page?
Johnny
For example:
?
code...
code...
code finished.
redirect(http://www.domain.com/admin.php;);
?
--
The above message is encrypted with
, March 28, 2003 3:56 PM
To: Johnny Martinez
Subject: Re: [PHP] Redirec.t
No. You have to send header information before you output anything even-
before the html. On your document, you have to put it before what is
currently line 12.
On Friday 28 March 2003 03:39 pm, you wrote:
Tried
is finished.
Johnny
-Original Message-
From: Evan Nemerson [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 3:56 PM
To: Johnny Martinez
Subject: Re: [PHP] Redirec.t
No. You have to send header information before you output anything even-
before the html. On your document, you have to put
Thanks! That worked!
Johnny
-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 4:53 PM
To: Johnny Martinez
Cc: '[EMAIL PROTECTED]'
Subject: Re: [PHP] Redirec.t
Try putting:
ob_start();
at the top of your file (before ANY output is done
28, 2003 8:37 PM
To: 'Leif K-Brooks'; Johnny Martinez
Cc: '[EMAIL PROTECTED]'
Subject: RE: [PHP] Redirec.t
Thanks! That worked!
Johnny
-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 4:53 PM
To: Johnny Martinez
Cc: '[EMAIL
Martinez [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 8:37 PM
To: 'Leif K-Brooks'; Johnny Martinez
Cc: '[EMAIL PROTECTED]'
Subject: RE: [PHP] Redirec.t
Thanks! That worked!
Johnny
-Original Message-
From: Leif K-Brooks [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 4:53
PROTECTED]
Sent: Friday, March 28, 2003 9:03 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Redirec.t
Yes, I agree it's a workaround, but sometimes it's required for code
readibility (and sanity! :) For example, what if I have multiple
pages
in one file, with a switch-case
9 matches
Mail list logo