You are here: PHP - Can I nest includes? « PHP Programming Language « IT news, forums, messages
PHP - Can I nest includes?

Posted by David on 10/01/00 11:26

Ok. Can I include a PHP file from a file that has been included.
From the example below, I have a start PHP page with an include to a
type of template page, and from page 2, I include a 3rd page. The
first include works, but the page 3 is brought in as standard text.
Is this a PHP limitation, or do I need to make a change to the PHP
config. file?

Thanks




(Page1)

<? include("page2.php"); ?>

(Page2)

<html>

<head>
<title>Sans Titre</title>
<meta http-equiv="content-type" content="text/html;
charset=iso-8859-1" />
<meta name="generator" content="HAPedit 3.1">
</head>
<body bgcolor="#FFFFFF">
<?
// Your code here
echo "<hr />\n".
"HAPedit 3.1.11.111 (September 2005 7:03:30 PM)<p>";
?>
requires("page3.php");
</body>

</html>


(Page3)

<?
$x = 100;
echo $x." This is a test";
?>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация