Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.php Subject: Re: Nested PHP Date: Sun, 02 Mar 2014 15:54:21 +0100 Lines: 51 Message-ID: <5313461D.70508@arnowelzel.de> References: <1lgvceg.n1ow4ilfgsk0N%adrian@poppyrecords.invalid.invalid> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Trace: individual.net 2af3UuxO12q6ivASE9+qLw42H+u3W0i2Fjqjf0E0GKFBJ+zPkx Cancel-Lock: sha1:lIGw+kJLlBcuKuABeACLw+tnDBU= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: <1lgvceg.n1ow4ilfgsk0N%adrian@poppyrecords.invalid.invalid> X-Enigmail-Version: 1.6 Xref: csiph.com comp.lang.php:13042 Adrian Tuddenham, 2014-02-10 21:24: > I am using a php program to generate and download a webpage as an HTML > file, the HTML file draws its headers and navigation bar from another > HTML file using some embedded php with an "include" command. > > The embedded php doesn't run when the file is downloaded, so the page > appears in the browser without its headers or navigation. PHP is only executed on the *server*. Any PHP which is "dynamically" added as output will *not* be executed at all. Example - if you have a file "test.php" and request it using the browser via http://mydomain.example/test.php: This will just output "Test". BUT: If the same will adds additional PHP code it will just be sent to the browser without any interpetation by the PHP runtime: If you really need to execute "dynamic" PHP, you have to use eval(), which executes the code passed as parameter: Even though this may work - the problem with eval() is, that it is horrible to debug. You don't have just a script but a script generating another script which will then be executed. I recommend to think about what you want to solve and if it is really neccessary to create "dyanamic" PHP on the fly. -- Arno Welzel http://arnowelzel.de http://de-rec-fahrrad.de http://fahrradzukunft.de