Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

opening php code from a text file

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Like the majority of users who post to PHP forums, I too am learning to use PHP. I know how to use fopen and the like to read from a file. To make my life a bit easier I am storing the header of my page in a seperate file and then using fopen to call the file and set it to a variable which I then echo to the screen. My problem is that if the file that I am opening contains php code, it is not processed.

How do I get PHP to process the code in the file? Is it even possible using this setup, and if not what would you recommend? Thanks for the help ;-)
 
look at the include() and require() directives. ______________________________________________________________________
Don't say thanks. Just award stars.
______________________________________________________________________
 
And give the file a .php extension ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top