The14thGOD Posted August 6, 2009 Share Posted August 6, 2009 I am creating new pages from "templates" (not actual .tpl files) however when I go to view the page, the page just shows the html portion. None of the includes are triggered to bring in the css/js head links, navigation, or the footer. I download the files from the server and everything is right. I tried setting permissions to 755 and 644 (this is what all the files i uploaded via ftp appear as) using: <?php chmod("../$newpage",0644); chmod("$newpage",0644);?> But that's not doing anything. Does anyone know what I have to do in order to get the PHP code to work? Thanks for any and all help, Justin Quote Link to comment Share on other sites More sharing options...
ram4nd Posted August 6, 2009 Share Posted August 6, 2009 this is coding help, you are at the wrong place Quote Link to comment Share on other sites More sharing options...
The14thGOD Posted August 6, 2009 Author Share Posted August 6, 2009 Perhaps I should rephrase this... I'm creating pages from templates using PHP for a CMS. However when I go to view the pages created the PHP doesn't run so I'm left with half a page. Is there something else in the code to create a file that I need to specify in order for the PHP code to run? <?php //open files for reading $fh = fopen ($filename, "r") or die ("couldn't open file"); $fh2 = fopen ($filename2, "r") or die ("couldn't open file"); //get data from files $data = fread($fh,filesize($filename)); $data2 = fread($fh2,filesize($filename2)); //close files fclose($fh); fclose($fh2); //new files $fh = fopen("../$newpage","w") or die ("couldn't make file"); $fh2 = fopen("$newpage","w") or die ("couldn't make file2"); //replace content in the data $data = str_replace('0000000000',"$pageid",$data); $data2 = str_replace('0000000000',"$pageid",$data2); //Proper navigation heading? switch($parent_page){ case 1: //home $data = str_replace('<body>','<body id="page1">',$data); $data2 = str_replace('<body>','<body id="page1">',$data2); break; //etc etc.... } //write the data into the files fwrite($fh,$data); fwrite($fh2,$data2); //close files fclose($fh); fclose($fh2); //set permissions chmod("../$newpage",0644); chmod("$newpage",0644); ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.