Hi All,
I have a basic CMS that saves the data into a MySQL text field. My client wants within one of the pages a contact form so I somehow need to replace a keyword within the content string from the DB with an include file, below is what I have so far but it is just producing 1 each time.
Any idea where I am going wrong?
Thankyou
// FUNCTION TO REPLACE
function code_include($text, $keyword, $file)
{
ob_start();
include($file);
echo $file;
$includeText = ob_end_clean();
return str_replace($keyword, $includeText, $text);
}
// DEFINE STRING FROM DB
$content_string = stripslashes($content->description);
// DEFINE KEYWORD
$thekeyword = 'FORMINSERT';
// DEFINE THE FORM
$registration = $_SERVER['DOCUMENT_ROOT']."/includes/inc_fusion.php";
// ECHO THE RESULT OUT
echo code_include($content_string, $thekeyword, $registration);