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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
Ray Hauge
Programmer/Systems Administrator
American Student Loan Services
http://www.americanstudentloan.com
1.800.575.1099

On Monday 16 January 2006 03:14 pm, tg-php@xxxxxxxxxxxxxxxxxxxxxx wrote:
> On your web server you can configure 'default pages'.  Apache and *nix type
> servers seem to favor the "index.html" type default pages while Microsoft's
> IIS goes for the "Default.htm" just to be different.  But you can add
> default pages to a list in the order you want them accepted.
>
> For instance, if you use PHP a lot (which I think we all do :) but you have
> a lot of directories that just have static HTML in them, you might have:
>
> index.html
> index.php
>
> (or vice versa) as your default pages list.  If it doesn't find any of
> those in the directory being accessed, then you should get your good old
> 404 error.
>
>
> Should just be a matter of adding "start.php" to your defaults list in
> whatever priority order you want.
>
>
> I think that'll do it for ya.   If you're going through an ISP, they still
> may have a way that you can set your defaults, possibly through .htaccess
> or some other Apache type prefs setting mechanism.
>
> Good luck!
>
> -TG
>
>
> = = = Original message = = =
>
> Hello,
>
> What would be the best way to get a page variable like this:
>
> www.domain.com?page=home
>
> to show up when a user types in:
>
> www.domain.com
>
> My current fix is to have this:
>
> header("Refresh: 0; URL=http://www.domain.com/start.php?page=home";);
>
> .. on a index.php page on the root..
>
> Is there a way I can do this and avoid having a page that just does
> redirection?
>
> Thanks for help.
> Cheers,
> Micky
>
>
> ___________________________________________________________
> Sent by ePrompter, the premier email notification software.
> Free download at http://www.ePrompter.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux