Hey guys,
I have a text file with a few vars at the top and html following....
<?php
$var['page_title_tag'] = "Page Title Such As Contact Us";
$var['name2'] = "value2";
?>
My <b>HTML</b> code is here...
This file is then executed using eval into an object - so the output is then used in a template script. The same with the initial $vars. Expect they are already present due to the eval, and can be used in the template such as...
<title><?= $var['page_title_tag'] ; ?></title>
Great! that works fine. Now the problem I have is with the admin area.
This file contents (such as above) is inserted into a textarea and when the form is submitted the actual file contents is replaced with the modified code from the textarea.
How can i seperate these initial variables from the HTML? So I have the $var array in one location and the HTML in another.
Maybe, use regex to obtain the PHP code?
Let me know if I havnt explained it to well.
Ben