duanlun4411 2014-04-06 11:30
浏览 122
已采纳

PHP文件无法运行

I have this two files:
index.html

<html>
<body>

<form action="welcome.php" method="post">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit">
</form>

</body>
</html>

And welcome.php

<html>
<body>

Welcome, <?php echo $_POST["name"]; ?><br>
Your email address is: <?php echo $_POST["email"]; ?>

</body>
</html>


This is example from there

When the user fills the form and hits "enter" it should display:

Welcome, the_name_you_enter
Your email address is address_you_enter

But for me it only displays welcome.php source code (I am using Safari 7). Does anyone knows why?

  • 写回答

2条回答 默认 最新

  • doujiekeyan0622 2014-04-06 11:34
    关注

    This usually happens because the PHP file is not executed on a web server or PHP is not enabled on your webserver.

    You are probably trying to access the file directly using file://

    Take a look at MAMP (I am assuming you are using OS X)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样