[SOLVED] problem with $_GET

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Barchie
Forum Newbie
Posts: 2
Joined: Mon May 29, 2006 7:17 am

[SOLVED] problem with $_GET

Post by Barchie »

Hi all,

Im having a bit of a problem i can get the $_GET to pull a variable from the url however how would i go about having a fallback if that variable does not exist in the url.

eg. index.php?page=home (works fine)
however when i put in index.php its wondering where the page=*.* is.

Any help would be appreciated

Barchie
User avatar
aerodromoi
Forum Contributor
Posts: 230
Joined: Sun May 07, 2006 5:21 am

Re: problem with $_GET

Post by aerodromoi »

Barchie wrote:Hi all,

Im having a bit of a problem i can get the $_GET to pull a variable from the url however how would i go about having a fallback if that variable does not exist in the url.

eg. index.php?page=home (works fine)
however when i put in index.php its wondering where the page=*.* is.

Any help would be appreciated

Barchie

Code: Select all

if (empty($page)) $page = "home";
aerodromoi
Barchie
Forum Newbie
Posts: 2
Joined: Mon May 29, 2006 7:17 am

you beauty

Post by Barchie »

solved all my problems mate. thanx

Barchie
Post Reply