hi guys any idea how i can insert a whole html code in $content please ? basically i want to paste my html template after $content ='whole html code goes here' any ideas ? thanks in advance

<?
if(isset($_POST['save']))
{
$pagename = $_POST['pagename'];
$content = 'test';

$filename = "cms/pages/$pagename.php";
$filehandle = fopen($filename, 'w') or die("can't open file");

fwrite($filehandle, $content);

fclose($filehandle);
}
?>

You could include it. Your included file could be a PHP file containing the html with a $content = " statement before it.

You could also use fread to read it into $content.

i dont wont to give up on it yet.

is there any way to insert this:

include '../core/config.php';
include '../core/opendb.php';

$query = "SELECT id, name, content, updated ". "FROM news ". "WHERE id = '1'";
$result = mysql_query($query) or die('Error : ' . mysql_error());
list($id, $name, $content, $updated) = mysql_fetch_array($result, MYSQL_NUM);

include '../core/closedb.php';

into this:

<? $template = "template goes over here..."; ?>

i will be glad if if i solve this issue. thanks in advance

I have always admired fortitude.

Airshow

and i always appreciate help :)

This article has been dead for over six months. Start a new discussion instead.