ok ive written my own CMS but im having problems when i place html code in the content it is saved into the database as i enter it which is what i want it to do but what i want it to do when i view the page is to process the html code as it should but it isnt its printing the code as text:
like so:
Welcome to my YouTube Page, here you an find all my Video i've uploaded to YouTube, my channel is available at: [url]http://youtube.com/user/homer090[/url]
<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/yygT4mk6Cdg"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/yygT4mk6Cdg" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
when what i want is the video embeded as its ment to be?
here is the code of the file that write the content to the DB:
<?php
include "../config.php3";
include "../dbconnect.php3";
$id = $_REQUEST['id'];
$cont1 = $_POST['Content_Name'];
$content = $_POST['content'];
$content = addslashes($content);
$visible = "1";
$query = mysql_query("UPDATE $table1 SET published='$visible',displayname='$cont1',content='$content' WHERE id='$id'",$conn) or die (mysql_error());
echo "Content: '$cont1' has been updated <a href='index.php?page=contentlist'>Click here to return to content list</a>";
?>
and the file that gets the content from the DB and display it:
<?php
include "config.php3";
include "dbconnect.php3";
include "Admin/bbcode.php";
include "Admin/test.php";
$id = $_REQUEST['pageid'];
if( isset($id) )
{
$a = "SELECT * FROM $table1 WHERE id='$id' AND published='1'";
$rows = mysql_query($a) or die (mysql_error());
while ($b = mysql_fetch_array($rows)){
$str = $b['content'];
}
$test = mysql_num_rows($rows);
if($test == 1)
{
$text = $str;
$str = parse_php($text);
$cont = bbcode_format($str);
echo nl2br($cont);
}}
elseif($id = '000')
{
$rows = mysql_query("SELECT * FROM $table1 WHERE id = 000");
while ($b = mysql_fetch_array($rows)){
$str = $b['content'];
$cont = bbcode_format($str);
$text = $str;
$str = parse_php($text);
$cont = bbcode_format($str);
echo nl2br($cont);
}}
?>
test.php is a file used to parse php text contained within the content.