• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

password protect my web page

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,all,
Does anyone know how to passpord protect my web page?Tks!
Frances
 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Well..." (like former USA President Reagan would say...)
the "poor man's" way of doing it (i.e., w/o encryption and SSL etc.) is to give the filename an impossible name to guess and require it as a password in a JavaScript dialog box.
Then you use the text entered as password to construct the complete file name.
For example, if the password is "abc", then when the user enters "abc" in the dialog box you use that text to generate "abc.html" and then load the document onto the browser in a new window.
If the user enters the wrong "password", a "404 Not Found"-like error would be sent to the browser.
 
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Depends on what web server you are running. If you want a pop-up box, then you need to make it so that directory is not shared except to users with the password, but as far as I know, that will depend on what web server you are using.
Or you can use a database or something like that to create an HTML login screen. This is good if you have database access.
Bill
 
Frances Fang
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you guys.
Frances
 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a similar problem. A section of our web site is password protected. I prompt the user to enter a certification number at a login page. This number is compared against a personnel database. If the certification number entered matches the number in the database, I use a response.redirect command to send the user to the secure page. The problem is that the user can bookmark the secure page and return to it without going through my login page.
I tried to implement a security verification process by setting a cookie when a user succesfully logs in to the page, and have the cookie expire when the user ends the session. Then, if the user tried to return to the bookmarked secure page, the page would check for the cookie. If the cookie was not found the user would be sent back to the login screen using the Response.Redirect command. Does this sound like a good way to secure a website?
Another problem I have is securing pdf files on our web. Any ideas?
Thanks in advance.
-Bob
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bob,
You could get around your security problem with some code like this:

This will redirect the user to an error page if they didn't go through your start page to get to the current page.
[This message has been edited by Bodie Minster (edited January 26, 2001).]
 
bill bozeman
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bob, that is basically how I have done HTML logins. I don't use redirects as much, I have used ASP which will assign a session value for the user after they login. Then on all the member pages I have a method that runs at the top of the page that checks the session value. If it is not there, I show the login page and not the member page.
Bill
 
Bob Reardon
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys!!
-Bob
 
Bob Reardon
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One more thing. Can I implement a similar security plan for pdf files I have on the web?
Thanks again
-Bob
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic