FrontPage? Online Support – SiteCrafters
FrontPage? Online Support – SiteCrafters Internet Services. It’s been bothering me how to put a simple password on my hosted web site. It’s actually quite easy to password protect if you have IIS on a machine where you control the directory since it integrates with NT authentication. But, what if it is on a hosted site.
Here’s the simple trick on how to do this with ASPs. Basically, you set a session wide variable called pwfield and have it entered and then check it on every page you want protected. I’m going to do this for some photos and other things I have on tongfamily.com…
Enter the following in a file, say “password.inc”
Change the “letmein” to the new password. Change “password.htm” to reflect the name of the form page used to enter password.
pagePassword = “letmein”
passwordForm = “password.htm”
IF Session(“pwfield”) <> pagePassword THEN
IF Request.Form(“pwfield”) = pagePassword THEN
Then on every page you want to password protect, change the name to .stm so that server side includes are enabled and then insert the following line before the HTML tag.