我在学习PHP(所以我是新手)。我在和阿帕奇的XAMPP(XAMPPP)一起研究个人电脑(窗口7 ) 。
我有两个文件示例格式. html :
<html>
<body>
<form action="welcome.php" method="post">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>
</body>
</html>
并欢迎.php:
<html>
<body>
Welcome <?php echo $_POST["fname"]; ?>!<br />
You are <?php echo $_POST["age"]; ?> years old.
</body>
</html>
我创建了这2个文件,并且工作顺利。 星期一我遇到了一个问题, 即点击 buttom 峰顶查询时, 它会给我显示代码而不是结果 。 我搜索了几个论坛, 发现我需要为 httpd. conf (xamppp/pache/ conf/) 添加以下行 :
AddType 应用程序/ x- httpd-php- source.phps
Addype 应用程序/ x- httpd-php.php.php5.php4.php3.phtml.php
Then it worked. Today when I try again it shows me the code once more. Please help. It can t be so complicated!