Re: Redirec.t
| From: | Leif K-Brooks | Date: | Sat, 29 Mar 2003 00:52:41 +0000 |
| Subject: | Re: Redirec.t | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-141529@lists.php.net to get a copy of this message | ||
Try putting:
ob_start();
at the top of your file (before ANY output is done).
Johnny Martinez wrote:
Forgive me. I'm new to php. I put the function in my function.php include file which is loaded before I display anything. I want to redirect the browser to a new url once the php script is finished. Johnny -----Original Message----- From: Evan Nemerson [mailto:evan@coeus-group.com] 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 it before what is currently line 12. On Friday 28 March 2003 03:39 pm, you wrote:-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.Tried that...here is the error: Warning: Cannot modify header information - headers already sent by(outputstarted at D:\bmc\uploads\request_mdb\header.php:12) in D:\bmc\uploads\request_mdb\functions.php on line 16 Any ideas? Does this only work in the <head></head>? Johnny -----Original Message----- From: Evan Nemerson [mailto:evan@coeus-group.com] Sent: Friday, March 28, 2003 3:34 PM To: Johnny Martinez; php-general@lists.php.net Subject: Re: [PHP] Redirec.t 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 function to redirect a browser to a specific page? Johnny For example: <? code... code... code finished. redirect("http://www.domain.com/admin.php"); ?>