dongwei5794 2016-04-25 18:05
浏览 70

使用POST方法输入的数据显示在URL中

I'm trying to send text entered in forms in an HTML page to a PHP page. However, what should be hidden with a POST method is instead showing up. Code here:

<!DOCTYPE HTML>

<head>

</head>

<body>

<h1> Your daily tasks </h1>

<form>
<form action = "entry.php" method="post"> <!-- POST the data to entry.php. Don't know yet why we post to a php -->
 <input type="text" name = "Monday1" />
<input type="text" name = "Monday2" />
<input type="text" name = "Monday3" />
<br>
<input type="text" name = "Tuesday1" />
<input type="text" name = "Tuesday2" />
<input type="text" name = "Tuesday3" />
<br>
<input type="text" name = "Wednesday1" />
<input type="text" name = "Wednesday2" />
<input type="text" name = "Wednesday3" />
<br>
<input type="text" name = "Thursday1" />
    <input type="text" name = "Thursday2" />
    <input type="text" name = "Thursday3" />
<br>
    <input type="text" name = "Friday1" />
    <input type="text" name = "Friday2" />
    <input type="text" name = "Friday3" />

<input type="submit" value = "Commit"/>

</form>

</body>

</html>

If I put "Foo" in the first column, the URL becomes file:///C:/xampp/htdocs/productivitywebsite.html?Monday1=Foo&Monday2=&Monday3=&Tuesday1=&Tuesday2=&Tuesday3=&Wednesday1=&Wednesday2=&Wednesday3=&Thursday1=&Thursday2=&Thursday3=&Friday1=&Friday2=&Friday3=

Which it isn't supposed to do with POST methods. Also, is there a way to have the code show up as code without having to 4x space everything? It's annoying as hell to have to spacebar each line of code.

  • 写回答

1条回答 默认 最新

  • drtoclr046994545 2016-04-25 18:46
    关注

    Looks like the issue was an extra tag. Thanks!

    评论

报告相同问题?

悬赏问题

  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题
  • ¥15 虚拟机打包apk出现错误
  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备