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

Posted by NC on 11/15/41 11:26

David wrote:
>
> Can I include a PHP file from a file that has been included.

Yes.

> 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.

Well, I am surprised anything is including at all... Take a look:

> (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>

First of all, it it not requires(), but require(). Second, your
require() statements is outside of any PHP block and inside an
HTML block; it shouldn't have been executed at all...

Cheers,
NC

 

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

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