Re: Best way to do this: www.domain.com?page=var

From: Date: Mon, 16 Jan 2006 23:27:30 +0000
Subject: Re: Best way to do this: www.domain.com?page=var
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-228687@lists.php.net to get a copy of this message
I'm confused... why does everyone use a refresh??? According to me, that's not what a refresh is supposed to be used for (!). Why don't use a header('Location: http://www.domain.com/start.php?page=home'); for it? It's more in-line with RFC's - tul Ray Hauge wrote:
You could also check to see if $_GET['page'] contains a value, and if it does not, then redirect it. Something like this: if($_GET['page'] == ''){ header("Refresh: 0; URL=http://www.domain.com/start.php?page=home"); } Granted that isn't validating the $_GET['page'] variable input for security, but that should at least get you going. Also, that assumes that all your pages use the GET query to specify which page they are on. If that's just for the initial page, then you'd have to do some more qualification. HTH


« previous php.general (#228687) next »