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
Session(“pwfield”)= pagePassword
ELSE
Response.Redirect(passwordForm)
END IF
END IF
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.
<--#include "password.inc">

One response to “FrontPage? Online Support – SiteCrafters”

  1. Tina Clarke Avatar

    Hi
    Would you take the sitecrafters link off your page? The site has been taken over by a speculator and sadly sitecrafters as a frontpage resource is no more. Please don’t give the speculators the traffic for their gain.
    Thanks for your time
    Tina

I’m Rich & Co.

Welcome to Tongfamily, our cozy corner of the internet dedicated to all things technology and interesting. Here, we invite you to join us on a journey of tips, tricks, and traps. Let’s get geeky!

Let’s connect

Recent posts

Loading Mastodon feed…