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

From: Date: Thu, 08 Feb 2001 17:58:43 +0000
Subject: Re: include("blah.php?var=this"); doesn't work?!
Groups: php.general 
Request: Send a blank email to php-general+get-38787@lists.php.net to get a copy of this message
You don't need to go through these hoops. Any include page you use will automatically use any variable that has been set in the master page. Thus, all you need to do is include the book_reviews.php page, and the $asin variable will work in that one IF it has been set in the master file. If it hasn't, it won't, very simple. >From the look of it, it appears the book_reviews.php page also checks to see if the $asin >variable is passed, and that check will also work when it's an include page. So, basically you could replace your code with this: <? include("book_reviews.php"); ?> and you don't have to worry about the $asin variable, since the book_reviews.php page handles that. If it's set, book_reviews.php will see it and use it. If it's not set, book_reviews.php will also see that and work without it (since you've already told it how to handle that). ---------- Original Message ---------------------------------- From: "John Vanderbeck" <agathorn@cfl.rr.com> Date: Thu, 8 Feb 2001 12:27:20 -0500 >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 > >

« previous php.general (#38787) next »