开发者

My HTML/php page is presented as clear text in browser

I have this problem that my .php file is presented as clear text in the browser. I.e., the page is not transcoded in any way.

This is my html-fil with a form

<html> 
<head> 

</head> 
<body>
<form id="myForm" action="commentNoJQ.php" method="post"> 
    Name: <input type="text" name="name" /> 
    Comment: <textarea name="comment"></textarea> 
    <input type="submit" value="Submit Comment" /> 
</form>


<p>Click on the button to load result.html file:</p>
   <div id="stage" style="background-color:blue;">
          STAGE
   </div>
   <input type="button" id="driver" value="Load Data" />

开发者_如何学Python</body>
</html>

This is my .php file that the form is posting to. This file is presented as it is in the browser:

<html> 
   <head>
   </head> 
<body>

<?php
$myFile = "/Library/WebServer/testFile.txt";
$fh = fopen($myFile, 'w') or die("can't open file");

fwrite($fh, $_POST["name"]);

fclose($fh);

?> 

</body>
</html>

What is the problem?

It's php-related sine when I create a normal html-file to post to, the normal file is processed as it should be.

This is how it looks in the browser:

My HTML/php page is presented as clear text in browser

I checked the logs (access_log, error_log), no info at all. Are there any other logs I should check?

Using Apache 2.2 and Mac OSX 10.6.4

Thanks in advance!

/Niklas


PHP is not properly configured on Apache I think.

UPDATE: links http://php.net/manual/en/configuration.changes.php http://www.php.net/manual/en/install.macosx.php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜