GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP - Parsing PHP in includes (https://gfy.com/showthread.php?t=455929)

Dusen 04-14-2005 03:08 PM

PHP - Parsing PHP in includes
 
I'm trying to include() a file that has a .txt extension. What I'd like to do is parse some PHP on that text file as well.

It's not working

What I have done is set .txt as php parsable in htaccess. No go. Any ideas?

AcidMax 04-14-2005 03:11 PM

Why not just make the .txt a .php extension and include it?

Otherwise maybe you can try something like the eval function

http://us2.php.net/eval and see if that works.

-- below may or may not work for you --
$text = join('', file('/path/to/text/file'));

echo eval($text);

Serge Litehead 04-14-2005 03:18 PM

have it as .php and dont forget about opening and closing php tags <? ... ?> inside the include file.

Serge Litehead 04-14-2005 03:20 PM

Quote:

Originally Posted by Dusen
I'm trying to include() a file that has a .txt extension. What I'd like to do is parse some PHP on that text file as well.

It's not working

What I have done is set .txt as php parsable in htaccess. No go. Any ideas?

btw code or error msg would be helpful to see whats wrong.


All times are GMT -7. The time now is 02:00 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123