RE: [PHP] includes and variables
| From: | Martin Towell | Date: | Tue, 26 Feb 2002 22:29:34 +0000 |
| Subject: | RE: [PHP] includes and variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-86323@lists.php.net to get a copy of this message | ||
think of an included file as if it were part of the parent code.
so
file1.php
<?
echo $foobar;
?>
file2.php
<?
$foobar = "hello world";
include "file1.php";
?>
file2.php would basically be:
<?
$foobar = "hello world";
echo $foobar;
?>
HTH
Martin
-----Original Message-----
From: Pax [mailto:pax@cfl.rr.com]
Sent: Wednesday, February 27, 2002 9:24 AM
To: php-general@lists.php.net
Subject: [PHP] includes and variables
I am trying to separate html from php code. For more complicated pages I
intend to generate classes..but before I start doing that is there a
quick way to include html code that contains variables ? if the main
page has already defined those variables, are they going to be
automatically replaced?
In the above situation does the file to be included needs to contain <?
?> ?
Thanks
Paul
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php