Re: include("blah.php?var=this"); doesn't work?!

From: Date: Fri, 09 Feb 2001 06:32:37 +0000
Subject: Re: include("blah.php?var=this"); doesn't work?!
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-38905@lists.php.net to get a copy of this message
> Uh, why? Adding ?asin$asin makes absolutely no sense in an include since > included files share the same namespace as the parent file. You can > simply do: Er, Rasmus. Do you mean "scope"? You're usually right on target with your comments, so I'm sure that's what you meant.... :-) Speaking of namespaces.... Let me encourage the PHP development folks to add namespace support ASAP. I'd really like to make some of my apps PEAR-compliant, but I refuse to use the inane naming convention for classes that I'd need to. Dean. > > $asin = 123; > include 'book_reviews.php'; > > And the $asin variable will be accessible to you book_reviews.php script. > > -Rasmus > > On Thu, 8 Feb 2001, John Vanderbeck wrote: > > > I need to be able to do: > > > > <? > > if (isset($asin)) > > { > > include("book_reviews.php?asin=$asin"); > > } > > else > > { > > include("book_reviews.php"); > > }?> > > > > This is embeded in one of my sites pages..However, the call with the var > > added on won't work, it seems like its looking for a file with that whole > > name. Does anyone know how I can do this? > > > > - John Vanderbeck > > - Admin, GameDesign > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > For additional commands, e-mail: php-general-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#38905) next »