RE: [PHP] include() question
| From: | Dave | Date: | Fri, 15 Mar 2002 01:49:44 +0000 |
| Subject: | RE: [PHP] include() question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-88607@lists.php.net to get a copy of this message | ||
Missing close " for one.
v
include("index.php?var='$var'");
^
and you don't need to pass the $var to the include since it will be included,
and obviously you already have it declared.
if index.php contained
<?
echo $var;
?>
and the file you are in contained
<?
$var='blah';
include("index.php");
?>
then PHP reads this as
<?
$var='blah';
echo $var;
?>
as such, no need to pass $var to the file since the file is included then
parsed.
Dave
>-----Original Message-----
>From: Phil Schwarzmann [mailto:pschwar@jhmi.edu]
>Sent: Thursday, March 14, 2002 4:20 PM
>To: php-general@lists.php.net
>Subject: [PHP] include() question
>
>
>Why doesn't this work...
>
>include("index.php?var='$var');
>
>I want to include a page in my code and send a variable to it but I get
>some funky error.
>
>THANKS!!
>