Re: Another include ?

From: Date: Thu, 05 Apr 2001 14:09:46 +0000
Subject: Re: Another include ?
Groups: php.general 
Request: Send a blank email to php-general+get-47257@lists.php.net to get a copy of this message
"Mike" <mpeloso@princeton.edu> wrote: > Im trying to parse a file twice ,once to extract an include file(NOT using > the include() function) and again to parse the php code.Customer support for > my host says I can add the following line to an .htaccess file: > AddType text/x-server-parsed-html .phtml > > but that only parses the include file. I tried to add both: > AddType text/x-server-parsed-html .phtml > AddType application/x-httpd-php .phtml > > but that doesnt seem to work.Is this possable?? That won't work because PHP is parsing the included file, not Apache. PHP doesn't care what the extension on the file being included is. One solution is to go into the include file and put the entire file within a variable with the RHS of the variable enclosed in single quotes so the RHS doesn't get translated into values when first called. Then in your main PHP file that calls it use eval() to parse the variable before using it. -- Steve Werby President, Befriend Internet Services LLC http://www.befriend.com/

« previous php.general (#47257) next »