Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Web
Expertise: All
Apr 20, 1999



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Make ASP Scripts Portable With Request.ServerVariables("SCRIPT_NAME")

A common technique in Active Server Pages (ASP) is to use server-side code to check that the user has filled in a form. In effect, you submit the ASP page to itself and the code decides whether to display the form again or move on. Rather than hard-coding the script name in the form's Action attribute, you can make your scripts more portable. Internet Information Server (IIS) and ASP supply the name of the script that is being executed as part of the server variables:
<FORM name="myform" action="<%=Request.ServerVariables("SCRIPT_NAME")%>">
<INPUT type=text name="mytextbox">
<INPUT type=submit>
Even if you rename your ASP page, the HTML form will still hit its target.
Ken Cox
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date