RE: [PHP] header() ???

From: Date: Thu, 14 Sep 2000 04:44:08 +0000
Subject: RE: [PHP] header() ???
Groups: php.general 
Request: Send a blank email to php-general+get-16697@lists.php.net to get a copy of this message
Jason, I checked the book "Professional PHP Programming" and refer to how they use header(): if (!authenticateUser($cookie_user, $cookie_passwd)) { header("Location:http://$HTTP_HOST/$DOCROOT/default.htm"); exit(); } what difference does that make if I do this instead: if (...) { include "http://$HTTP_HOST/$DCROOT/default.htm"); exit(); } I guess my question is really this: header is used here to redirect user to other pages, but is it equivalent of doing this using include in this case? ---Sonia -----Original Message----- From: Jason Murray [mailto:Jason.Murray@melbourneit.com.au] Sent: Wednesday, September 13, 2000 8:54 PM To: 'Sonia Tsui'; 'php-general@lists.php.net' Subject: RE: [PHP] header() ??? > Could you please give me a case under which header() need to be used? You may wish you verify a user's form input, and redirect them to an error page if it is not filled in properly. Or you may want to redirect on, say, a checkout page if you can't find a session identifier. Jason

« previous php.general (#16697) next »