RE: [PHP] Go directly to a page

From: Date: Sun, 15 Oct 2000 23:55:03 +0000
Subject: RE: [PHP] Go directly to a page
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-20279@lists.php.net to get a copy of this message
<?php header("Location: http://204.205.173.133/test/test.php"); ?> Note: This must come before *any* output is sent to the browser. For example, if, right now, users are going to: http://204.205.173.133/test/somepage.php , somepage.php should look something like: --somepage.php-- <?php header("Location: http://204.205.173.133/test/test.php"); ?> This would be invalid: --somepage.php-- <?php header("Location: http://204.205.173.133/test/test.php"); ?> It is invalid because there is a blank line that is sent to the browser. You could redirect users depending on variable (like if they entered something from a form: --fromform.php-- <?php if($userInput == "a") header("Location: http://204.205.173.133/test/a.php"); if($userInput == "b") header("Location: http://204.205.173.133/test/b.php"); if($userInput == "c") header("Location: http://204.205.173.133/test/c.php"); if(($userInput != "a") || ($userInput != "b") || ($userInput != "c")) header("Location: http://204.205.173.133/test/wrong.php"); ?> marco -----Original Message----- From: Todd Cary [mailto:todd@aristesoftware.com] Sent: Sunday, October 15, 2000 4:51 PM To: php-general@lists.php.net Subject: [PHP] Go directly to a page In PHP, how can I send the surfer directly to a page? I want to send the surfer to http://204.205.173.133/test/test.php Todd -- Todd Cary Ariste Software todd@aristesoftware.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#20279) next »