duvys Posted May 15, 2007 Share Posted May 15, 2007 I have a .txt file that I need to keep the extension .txt and I need to pull some information from a MySQL database. Is there any way I can get the server to read php commands in this file even though it doesn't end in .php ? I would rather not set all txt files on the server to run as PHP. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/51506-solved-can-i-use-php-in-a-txt-file/ Share on other sites More sharing options...
Dragen Posted May 15, 2007 Share Posted May 15, 2007 no... not to my knowledge. It must end with php Quote Link to comment https://forums.phpfreaks.com/topic/51506-solved-can-i-use-php-in-a-txt-file/#findComment-253657 Share on other sites More sharing options...
Orio Posted May 15, 2007 Share Posted May 15, 2007 Read: http://www.php.net/manual/en/security.hiding.php This can be done with .txt Orio. Quote Link to comment https://forums.phpfreaks.com/topic/51506-solved-can-i-use-php-in-a-txt-file/#findComment-253663 Share on other sites More sharing options...
MadTechie Posted May 15, 2007 Share Posted May 15, 2007 that will affect all .txt files maybe a .htaccess file to redirect something.txt to something_else.php just a thought Quote Link to comment https://forums.phpfreaks.com/topic/51506-solved-can-i-use-php-in-a-txt-file/#findComment-253667 Share on other sites More sharing options...
duvys Posted May 15, 2007 Author Share Posted May 15, 2007 The htaccess fiel should be fine. I can apply it to a specific file or even if I apply it to a folder won't be so bad - as long as it isn't across the board. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/51506-solved-can-i-use-php-in-a-txt-file/#findComment-253677 Share on other sites More sharing options...
MadTechie Posted May 15, 2007 Share Posted May 15, 2007 please click solved!!! Quote Link to comment https://forums.phpfreaks.com/topic/51506-solved-can-i-use-php-in-a-txt-file/#findComment-253943 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.