Current location: Hot Scripts Forums » Programming Languages » PHP » PHP in text files from lead, how?


PHP in text files from lead, how?

Reply
  #1 (permalink)  
Old 04-22-09, 11:35 AM
jeppchen jeppchen is offline
Newbie Coder
 
Join Date: Apr 2009
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
PHP in text files from lead, how?

I have a text file in a PHP code to integrate, what must I do to the PHP in the text file is executed? Changing the file extension is not in question, as the text for all script files must remain so.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 04-22-09, 11:54 AM
End User's Avatar
End User End User is offline
Level II Curmudgeon
 
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
Quote:
Originally Posted by jeppchen View Post
I have a text file in a PHP code to integrate, what must I do to the PHP in the text file is executed? Changing the file extension is not in question, as the text for all script files must remain so.
You could use eval(), but that has inherent risks if the data isn't sanitized.
__________________
I don't live on the edge, but sometimes I go there to visit.
-------------------------------------------------------------------------
Sanitize Your Data | Oracle Date & Substring Functions | Code Snippet Library | [url=http://www.codmb.com/Call Of Duty[/url]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 04-22-09, 01:24 PM
bizzar528's Avatar
bizzar528 bizzar528 is offline
Community Liaison
 
Join Date: Sep 2004
Location: Pennsylvania, US
Posts: 1,551
Thanks: 2
Thanked 16 Times in 15 Posts
You could also add an htaccess application type to tell the web server to process the file as a php file even with a non .php extension.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge PHP files eddyvlad PHP 1 05-11-07 03:21 AM
.csv files to php TGyll Script Requests 7 01-25-07 04:22 AM
php text link pucker22 PHP 1 06-11-06 03:58 PM
Adding a Hyper Link to a Text statement in PHP kpowers4 PHP 2 04-08-06 12:48 AM
php files in a cgi-bin directory epic1231 PHP 7 12-31-03 04:42 PM


All times are GMT -5. The time now is 10:27 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.