0

Hi,

I have the following situation;
I made a website where I can manage the pages. One option, where I add more pages, is giving me problems.

When working on my localhost everything works perfectly, and the generated file is being processed correctly. Online however is results in a very poor result

My code to generate

$link = 'test.php';               
$f = fopen($link, "w+");
/* content php file */
$line .= '<?php
    /* pagina */
    $pagenum = \''.$newnum.'\';
       
    /* include het hoofdonderdeel dat overal gelijk is */
    include(\'ins_header.php\');
   
?>
    <div id="contentcontainer" class="floatleft">
        <div id="contentaligner">
            <div id="contenttitel" class="floater">
                <?php echo $titel; ?>
            </div>
            <div class="floater">
                <?php
                    /* aanroepen content */
                    if($pagenum) echo request_content($pagenum);
                ?>
            </div>
        </div>
    </div>
<?php
    /* include het voetonderdeel dat overal gelijk is */
    include(\'ins_footer.php\');
?>';
fwrite($f, $line);
fclose($f);

the generated file is correct. When I pull it of the server it is also the way it should be. Localhost makes the PHP do its magic with the includes en function, online I get this result

<div id="contentcontainer" class="floatleft">
	<div id="contentaligner">
		<div id="contenttitel" class="floater">
						</div>
		<div class="floater">

Now the funny thing is, when I pull the file from the server and upload that exact same file back to the server... it works

So... why does my PHP file generated on the server not work, except when I reupload is manually?

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by urtrivedi
0

edit:

also tried writing (w+) in an excisting and online working php file. And then copying copy(excisting, new) this file with its new name. Then both file stopped functioning

0

after generating file, set its permission to 777 (just to check whether permission issue or not).

Edited by urtrivedi: n/a

0

after generating file, set its permission to 777 (just to check whether permission issue or not).

CHMOD settings are auto on 644, like on every other file.

Just added

chmod($filename, 0777);

and checked on server. Now its 777. Still same result

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.