[thelist] Web site add on software

aardvark roselli at earthlink.net
Thu Jan 10 11:05:44 CST 2002


> From: "R.Livsey" <R.Livsey at cache-22.co.uk>
> 
> [tip type="server-side elegance" language="php"]
> 
> When you want a PHP page to submit a form to itself, instead of using
> the file name in the action field, use $PHP_SELF. This means that if
> you change the filename in the future, everything still works without
> having to touch a line of code!
> 
> [/tip]


<tip type="server-side elegance" language="asp">
When you want an ASP page to submit a form to itself, instead of 
using the file name in the action attribute, use this:

  <form action="Request.ServerVariables("SCRIPT_NAME")">

This means you can move the file anywhere or rename it, and it will 
always get its proper address.

You can also set Request.ServerVariables("SCRIPT_NAME") to a 
variable in a master include file, and use the variable for all sorts of 
things (like my low-budget ASP breadcrumb script, for example).
</tip>




More information about the thelist mailing list