I have my
$dbConnection
function ubbreplace($text){
if (strpos($text, "[contact-form]") !== false) {
ob_start();
include("contactform.php");
$replace = ob_get_contents();
ob_end_clean();
$text = str_replace("[contact-form]", $replace, $text);
}
return $text;
}
$dbConnection
$dbConnection
Added global $dbConnection;
inside the ob_start()
<?php
function ubbreplace($text){
if (strpos($text, "[contact-form]") !== false) {
ob_start();
global $dbConnection; // <-- added
include("contactform.php");
$replace = ob_get_contents();
ob_end_clean();
$text = str_replace("[contact-form]", $replace, $text);
}
return $text;
}
?>