try using a switch statement.  
 
<?    
   switch($vw)
         {
                        case "":
                        include "intro.php";
                        break; 
                        case "services":
                        include "services.php";
                        break;
                        case "next":
                        include "next.php";
                        default:
                        include "error.php";
                        break;
          }
 ?>
 
> -----Original Message-----
> From: Matt Zur [mailto:[EMAIL PROTECTED]]
> Sent: Monday, August 26, 2002 12:41 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] newbie... - undefined var
> 
> 
> I'm just starting to learn php and have a quick question. I'm making a 
> site with file includes.  so for example my default page will be:
> index.php and services page with be called services.php
> 
> BUT... I want to link to services via this method:  
> index.php?vw=services
> 
> Still no problem there.
> 
> BUT on the index.php I want to write this if statement:
> 
> if ($vw == "") {
> write this code
> }
> 
> But then I get an error that the var is non defined.  Do all 
> vars in PHP 
>     have to be defined first?  If it isn't defined, doesn't the program 
> assume it's value is nothing?
> 
> -Matt


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

Reply via email to