note 48013 deleted from function.include by nlopess
| From: | nlopess@php.net | Date: | Wed, 29 Dec 2004 11:48:32 +0000 |
| Subject: | note 48013 deleted from function.include by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-82450@lists.php.net to get a copy of this message | ||
Note Submitter: rjg4013 at rit dot edu
----
I've noticed that if you're trying to include a page that is going to use data available
on the page you're including from, you need to make it a relative link for it to be able to
understand the values. For instance...
<?php //includefile.php
echo $city->name;
?>
<?php //other file
$city = new City();
$city->name = "London";
//understands variable
include 'includefile.php';
//cannot read variable
include 'http://'.$_SERVER['HTTP_HOST'].dirname(
$_SERVER['PHP_SELF'] ).'/includefile.php';
?>
This drove had me hanging for a while. Hope it helps someone out.
~RJ