Yesterday, I learned an interesting lesson: PHP programmers are rrrreaaaallly sensitive. Honestly, be careful when suggesting that PHP (initially Personal Home Page tools, later changed to one of those ridiculous recursive acronyms, a programming language given for every $2/month web host plan, and a platform freely available for free operating systems), is overwhelmingly popular amongst hobbyist programmers. Don't even think of suggesting that using a scalable, vendor-supported, compiled, type-safe platform, such as ASP.NET or J2EE, is the only way to go for real web applications. You'll really hear it then. Heck, I'll even get some flak for suggesting not to suggest it.
But I digress. Yes, today I wanted to share with you an ASP page that Robin Rawson-Tetley came across while maintaining an e-commerce application at a client site. There was an interesting quirk about the site (naturally unrelated to the bug): when you went to checkout, it displayed the "please wait while we transfer you to our secure checkout" message and "clicked" quite a few times, indicating a lot of page redirects. What Robin discovered was the best way of avoiding Response.Redirect ever ...
<% '''''''''' ' httpsxfer.asp '''''''''' Dim fullUrl : fullUrl = _ "https://" & _ Request.ServerVariables("SERVER_NAME") & _ Request.ServerVariables("URL") %> <html> <body> <form method="get" action="<%=fullUrl%>"> <% 'GET ALL ITEMS IN QUERYSTRING AND RESUBMIT THEM Dim qsItm For Each qsItm In Request.QueryString %><input type="hidden" name="<%=qsItm%>"
value="<%=Request.QueryString(qsItm)%>"><% Next %> </form> <script language="javascript">document.forms[0].submit()</script> </body> </html>