First of all, you need to use the $_* superglobals if register_globals is
off.  That is, to access get variables, you use $_GET['variable_name']

To check if the variable is set, use the isset function.

if (IsSet($_GET['variable']) {
// code
}
else {
//error
}

----- Original Message -----
From: "Christian Ista" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 13, 2002 10:16 AM
Subject: [PHP] parse URL good syntaxe please


> Hello,
>
> Could you tell me why on PHP 4.2.2 this code work
>
> <?php
>   switch ($_GET['fuseaction'])
>  {
>     case 0:
>         print "i equals 0";
>         break;
>     default:
>         print "i is not equal to 0, 1 or 2";
>  }
> ?>
>
> and this one not :
>
> <?php
>   switch ($fuseaction)
>  {
>     case 0:
>         print "i equals 0";
>         break;
>     default:
>         print "i is not equal to 0, 1 or 2";
>  }
> ?>
>
> In both cases when fuseaction is not defined, I receive an error. Could
you
> tell me how to know if the variable is defined in the URL. In coldfusion
you
> can do <cfif isDefined("URL.fuseaction")>
>
> but in php ?
>
> Bye
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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

Reply via email to