I have an a.shtml page and a form on it. When i submit the form with POST i call a.cgi and redirect the page b.shtml from the cgi with META. But i saw on access.log that a.cgi executes two times. It causes some problems. Why it is called twice and the second one is with GET and how can i avoid this? It is only occurs on Chrome. IE,Firefox is OK

my form:

 <form method="post" action="cgi-bin/a.cgi"> ....</form>

meta inside the cgi:

 printf("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"3;url='/b.shtml'\ "/>");

access log:

..POST /cgi-bin/a.cgi HTTP/1.1|Host: xxx.xxx.xxx.xxx|Connection: keep-alive|Content-Length: 42|Cache-Control: max-age=0|Origin: .....
..GET /cgi-bin/a.cgi HTTP/1.1|Host: xxx.xxx.xxx.xxx|Connection: keep-alive|User-Agent: Mozilla/5.0 (Windows NT
有帮助吗?

解决方案

It sounds like you want to trigger a resubmission of an HTTP POST using a html meta refresh element.

I don't know if this is possible or reliable. Hopefully these terms help you with googling at least.

You may wish to look into using sessions instead.

Edit2:

I found this SO question: "POST-requesting a location sending Refresh header makes Firefox create GET request but still hold POST data"

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top