Jump to content


Read half a file, parse PHP and display results

  • Please log in to reply
No replies to this topic

#1 BrandonKahre

  • Members
  • Pip
  • Newbie
  • 6 posts

Posted 02 May 2006 - 11:20 PM

I have a unique situation where I need to be able to request a file (a template of my site actually), read it from <body> to <!-- ### ---> (non-inclusive), prase the PHP in between there, and display the results. After I do that I'll need to do the opposite: <!--- ### ---> to </body>

My first attempt at this gives me the straight code not parsed as PHP (the page I will be displaying this on, Miva shopping cart software, will not render PHP). I tried to use fopen and fgets.

Is there a better solution to this? I would like to avoid having to manually split the two files in half and including them that way, but if I do it that way, it will work. The problem with that is if I make changes to the template for my other pages, I have to manually copy the changes over to the second template pages.

Any ideas?



0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users