.php page view
Posted: Fri May 30, 2008 2:14 am
Hello,
I made a basic CMS that allows from the admin panel to create new .php pages. When the create button is pressed, a file containing php code is generated in the site.
My problem: the page is not displayed in the browser. If i copy the page from the root (ftp) to my PC and then upload the exact page it works.
the code that generates the page:
Does anyone know why the newly created page from the admin pannel isn't viewble in the browser after it's generated? Why it's only visible after I download it and upload it back to the ftp? What can I do?
I made a basic CMS that allows from the admin panel to create new .php pages. When the create button is pressed, a file containing php code is generated in the site.
My problem: the page is not displayed in the browser. If i copy the page from the root (ftp) to my PC and then upload the exact page it works.
the code that generates the page:
Code: Select all
$cod ='<?php
include \'count/headere.php\';
include \'admin/db.php\';
$query = "SELECT continut FROM mesaje where id=\''.$id.'\' ";
$result = mysql_query($query);
while(list($continut)= mysql_fetch_row($result))
{
echo $continut;
}
include \'count/footere.php\';
?>';
$pagina ="../$id.php";
$fp = fopen( $pagina, 'w' );
fwrite($fp, $cod);
fclose($fp);
chmod($pagina,0777);