Password Protect

They have: 9 posts

Joined: Feb 2001

I have a directory that is password protected... when I go to the URL I am prompted with a user id/password box. this is all good, but I want to access the protected dir through a form on another page using a field for the id and a field for the password...
can anyone help me?

[email protected]

detox's picture

They have: 571 posts

Joined: Feb 2001

How are you wanting to acheive this, through straight html javascript etc or by using asp etc.. Basically if your using client side scripting it can get a bit tricky, but server side scripting makes it so easy it's not funny!

They have: 9 posts

Joined: Feb 2001

Well, i was hoping to do it in HTML or JavaScript, but if there is an easy server side solution, i guess that will work.

detox's picture

They have: 571 posts

Joined: Feb 2001

comne to think of it, you cant do this client side.. you cant read or write to the filesystem object like you can with say ASP.

If you want to use ASP the it is quite easy to script for you, however it depends on whether or not your host will allow you to use asp. if it is a free provider you definately wont.

what kind of site is it - personal or business?

They have: 9 posts

Joined: Feb 2001

its a business im starting.
Im not sure if my host supports ASP. I know they support PHP...

detox's picture

They have: 571 posts

Joined: Feb 2001

If they support PHP then that's great... I assume you know how to program in PHP? to tell you the truth, the most i have ever looked into PHP was over the last 10 minutes! Because the coding looks foreign to me I would obviously stick with ASP - simply because monopoly-soft will continue to dominate the market and they are basically holding most of the chips. That being said I am sure that they laughed away JAVA!

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

same concept for PHP as ASP...
user logs in, you validate user/password, set a session cookie, and kill it when they leave...

Have you thought about password protecting the directory using the web server? This would save you from coding.

Mark Hensler
If there is no answer on Google, then there is no question.

They have: 9 posts

Joined: Feb 2001

Mark,
How would I go about password protecting the directory using the web server? im not familiar with that. I would love to do anything that would save me from coding...

BTW,
thanx for replying (detox too)

Mark Hensler's picture

He has: 4,048 posts

Joined: Aug 2000

what is the OS? (Win 9x,Win NT,*nix)
what is the web server? (Apache,IIS,PWS)

They have: 9 posts

Joined: Feb 2001

I believe its Unix/Apache.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.