You are here: Parsing a php include (which also contains php code) - or "Reparsing" the php file « PHP Language « IT news, forums, messages
Parsing a php include (which also contains php code) - or "Reparsing" the php file

Posted by Steven Borrelli on 06/20/07 03:16

Hello,

I am using the <?php include() ?> statement on my website for
organizational purposes. However, one of my includes contains some
PHP code. Is there any way for the server to actually parse the
include? I've tried this before, and it did not parse the include.
Rather, it included the file as just plain ASCII.
=======================
/*EXAMPLE 1*/
/*index.php*/
....
<?php include('global/includes/footer.inc') ?>
....

/*footer.inc*/
....
<p>&copy 1993-<?php echo date("Y") ?> Kingswood School. All rights
reserved.</p>
....

/*EXAMPLE 2*/
/*index.php*/
....
<?php include('global/includes/lastmod.php') ?>
....

/*lastmod.php*/
....
<?php
echo "This file was last modified: ";
echo strftime("%A %B %d %Y");
include('whateverfilename.inc');
?>

=============================

I would like to be able to parse the include if it has php code, and
in some cases, create nesting includes (an include within an
include). Is this even possible? Any ideas?

Any help is certainly appreciated. Thanks!

Steven Borrelli
Web Developer
Kingswood School

 

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

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