dongtanxi5676756 2013-06-20 05:14
浏览 20
已采纳

看到PHP输出

I have this simple HTML form. and A php script in my computer,

<html>
<body>
<form action="file:///home/tamim/welcome.php" method="post">
Name: <input type="text" name="fname">
Age: <input type="text" name="age">
<input type="submit">
</form>

</body>
</html>

And my welcome.php is

<html>
<body>

Welcome <?php echo $_POST["fname"]; ?>!<br>
You are <?php echo $_POST["age"]; ?> years old.

</body>
</html>

but when I submit., firefox gives me a prompt of what should it do with the welcome.php file? How do I run the php file on submit and see the output in commandline or browser or somewhere else?

  • 写回答

4条回答 默认 最新

  • dq_1984 2013-06-20 05:15
    关注

    Your form action should not be file path.It should be like

    <form action="http://localhost/your_proj_folder/welcome.php" method="post">
    

    You can place your IP instead of localhost (and considering that tamim is your folder name where you have placed these files then place your folder name tamim after the localhost)

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

报告相同问题?

悬赏问题

  • ¥15 教务系统账号被盗号如何追溯设备
  • ¥20 delta降尺度方法,未来数据怎么降尺度
  • ¥15 c# 使用NPOI快速将datatable数据导入excel中指定sheet,要求快速高效
  • ¥15 再不同版本的系统上,TCP传输速度不一致
  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式