Showing posts with label Classic ASP. Show all posts
Showing posts with label Classic ASP. Show all posts

Friday, April 27, 2007

Implementing a "Click Through" in Classic ASP

To simulate a client request for a given url, use Javascript that automatically fires during the test page load event.
To test that this "referral" script works, point the "referrer" to a handy ServerVariables display page.

Both the "referrer" (click.asp) and the "target" (servervars.asp) are illustrated here.
Here is a screen shot of the resulting HTTP_REFERER display page (servervars.asp)

Here's How you Force SSL in Creaky Old ASP

Say you have a Classic ASP site or application where you want to force a secure (SSL) connection.

Use the ASP ServerVariables collection to check the current connection, then redirect appropriately.

Copy/Paste the following into a text file and name it ForceSSL.asp:

<%

If UCase(Request.ServerVariables("HTTPS")) = "OFF" Then
'''get page
    sRedirect = "https://" & Request.ServerVariables("SERVER_NAME") &
    Request.ServerVariables("PATH_INFO") & "?" & Request.Querystring
    Response.Redirect sRedirect
End If

%>

For each page in the site/application, add a server-side include that looks like this:

<!--#include virtual="/ForceSSL.asp"-->

AG, hope this helps you out. I'm probably weeks too late.