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条)

报告相同问题?