1

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
brknl
  • 115
  • 9

1 Answers1

1

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"

Community
  • 1
  • 1
Lethargy
  • 1,859
  • 14
  • 15
  • Thank you for your reply. Besides the link redirect me to a true information about meta and refresh usage, I have found that html validator add on causes this problem. I've just installed that add on and after i disabled it, the problem has solved. – brknl Nov 05 '12 at 13:00