.php page view

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
yetti
Forum Newbie
Posts: 2
Joined: Fri May 30, 2008 2:02 am

.php page view

Post by yetti »

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:

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);
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?
nowaydown1
Forum Contributor
Posts: 169
Joined: Sun Apr 27, 2008 1:22 am

Re: .php page view

Post by nowaydown1 »

Sounds like a permissions problem of some variety. I would log in with your FTP client and look at the permissions & owner/group of a file that doesn't work and see how that compares to a known working PHP file.
Post Reply