dongzi0857 2017-04-05 12:32
浏览 55
已采纳

PHP表单重定向到错误链接

Using HTML form with action = "www.google.com", but it redirect to link including localhost/www.google.com . My example code is for your reference. Please anyone help me.

My Forms as follows :

<form method="POST" action="www.google.com">
  <p>
<label for="name">Name:</label>
<input type="text" name="name" id="name">
  </p>
  <p>
<label for="email">Email:</label>
<input type="email" name="email" id="email">
  </p>
  <p>
<label for="comments">Comments:</label>
<textarea name="comments" id="comments"></textarea>
  </p>
  <p>
<input type="submit" name="send" id="send" value="Send Comments">
  </p>
</form>

But, the file when click send button, it redirects to " http://localhost/basic/www.google.com" error page. Can any one suggest me to resolve the issue.

  • 写回答

2条回答 默认 最新

  • dongting7352 2017-04-05 12:45
    关注

    It is not allowed to send POST request directly to google.com. Why do you want to do this? In the action argument you should have own script which can process request from your form.

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

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?