I have the following line of php code in some of my pages
<?php include("contactform.php"); ?>
I have a crude CMS where I exchange lines of code for user manageable tags, my hope is to convert this line of code into [contact] so that people can add or remove it at their leisure. This is how far i've got...
i.e. $file = preg_replace('#<?php include("contactform.php"); ?>#i', "[contact]", $file);
$file looks something like this...
<h1 class="title">Title</h1>
<p>Text</p>
<?php include("contactform.php"); ?>
So the PHP code has not been stripped out by the server as we are editing the file and not viewing it.
I'm pretty new to PHP so I guess i'm being really stupid, is there a way to do this?