I have a site and I need to change the way it functions basically $pageBody contains all the code for the page, but where I have a form I want to be able to include it using ==Contact== which will then load a contact form in the place of the text. The form will be loaded in a form called Contact.txt. However I need this to be done dynamically as there will undoubtedly be other bits that I try to include in that way.
Question
JTW
Hi,
I have a site and I need to change the way it functions basically $pageBody contains all the code for the page, but where I have a form I want to be able to include it using ==Contact== which will then load a contact form in the place of the text. The form will be loaded in a form called Contact.txt. However I need this to be done dynamically as there will undoubtedly be other bits that I try to include in that way.
Here is what I have done so far;
$pageBody = str_replace("==(.*?)==", include($1.".txt"), $pageBody);But that gives me the following error;
Any help would be great!
Thanks
Joe
Link to comment
Share on other sites
5 answers to this question
Recommended Posts