hi all,
Im quite new to php and mysql but i am making a CMS for my self just to try out new skills and stuff.
And everything is great apart from if i go into my admin area and enter PHP with the <?php ?> tags around in like say the content box (instead of just plan text)
when you go to the public site it does not run the php or even just echo the php on the screen as text but if you go to view page source (on Firefox for me) i can see the php but its in a pink text like is been converted into a comment or something.
does anyone know what could be causing this? i followed a tutorial on how to make my CMS and the only thing i can think that might do it is magic quotes?
Does anyone agree or no how to fix it to let my data pulled from the Mysql data base be viewed as php?
its as if when data is pulled from the databases it does not know what to do with it and just turns it into a comment or something.
here is the code in a function:
function blog_content() {
$output = "<ul>";
$subject_set = get_all_blog_public();
/*while loops to get subject */
while ($subject = mysql_fetch_array($subject_set)) {
/*echo the subject */
$output .= "-<a href=\"blog.php?num=" ;
$output .= urlencode($subject["id"]) ."\">";
$output .= ucfirst($subject["menu_name"]);
$output .= "</a><br/><br>";
}
$output .= "</ul>";
return $output;
}
and here its the bit that pulls the what ever is in the database and shows it on the public page:
echo nl2br($sel_subject['content']);
and i want it to echo this:
echo blog_content();
but does not work all i get its
<?php echo blog_content(); ?> in pink on the html side..
anyone help?
Thanks Eli