Re: PHP in PHP

From: Date: Mon, 04 Sep 2000 17:59:52 +0000
Subject: Re: PHP in PHP
Groups: php.general 
Request: Send a blank email to php-general+get-15163@lists.php.net to get a copy of this message
Hey, did you try "Miscellaneous functions", "eval"? <? $fp = fopen("myFile.php", "r"); $myFileAsString = fread($fp, 100000); echo eval("?>$myFileAsString<?"); fclose($fp); ?> That should work, also if the file is .htm Note that "eval" expects php-code, therefore the 'inverted' ?><?. You wrote: >The structure with frames is ready-to-go and online since 2 years. This >are 90% htm-pages and I do not want to change it into .php because I got >them into a lot of search-engines. To process .htm files as PHP is usually easiest done with Action+AddType in .htaccess: Action application/x-php3 /cgi-bin/php.cgi AddType application/x-php3 .php3 .php4 .htm (etc.) Hope it helps! Best regards Soren "Frank" U5com Co Ltd At 11:13 4/9/00 +0200, you wrote: >Hello ! > >I want to offer 2 possebiliys to watch my pages: >- with frames (the menus are in a frame) >- without frames (the menus are above every page) > >The structure with frames is ready-to-go and online since 2 years. This >are 90% htm-pages and I do not want to change it into .php because I got >them into a lot of search-engines. > >The idea now was to take a page, parse it through a php script (add the >menus and change all links and so on) and then put it out. I made >something like shop.php?page.htm to do this, which loads page.htm, parse >it, changes all linkk into shop.php?... and print it out. This works >fine. > >The problem: >I got some php-pages, so I got to call shop.php?page.php. When now >loading the page.php, I got the php-code and not the php-output of >page.php. > >How can I get a PARSED version of page.php as a string ? > >Regards > >Martin >

« previous php.general (#15163) next »