From what I can tell, there is no other similar inquiry around...
I'm completing my Higher School Certificate (final year of high school in New South Wales Australia) and I'm creating a web system for a major.
Part of it requires me to have fully dynamic pages for my clients purpose, and I'm using database elements - so basically there is a BB Code site editor that translates [element=menu] to <?php elementCreate("menu"); ?>
What I'm finding for some reason I can't contemplate, is that it's just blatantly not working! And when I use view source the <?php elementCreate("menu"); ?> is green as if it's a comment?
- Code: Select all
function bbElement($transform){
$a = array(
"/\[element=\"(.*?)\"\]/is",
);
$b = array(
"<?php echo elementCreate($1); ?>",
);
$transform = preg_replace($a, $b, $transform);
return $transform;
}
- Code: Select all
function elementCreate($element){
$element_fetch = mysql_query("SELECT * FROM `elements` WHERE `element_name` = '".$element."'")or die(mysql_error());
while($element_info = mysql_fetch_array($element_fetch, MYSQL_ASSOC)){
$econt = $element_info['content'];
}
return $econt;
}

It is highly likely I'm just missing something? But any help is appreciated! Cheers!
Jake



