password protection

merlin's picture

They have: 410 posts

Joined: Oct 1999

hi there
i have an application, written in perl, using a mysql-db. in short words: it's for searching, adding, changing events through a web-browser.

everything's working fine. i only need to protect the administrating part of the application with a password. since it's only used in an intranet, i don't need a strong protection (1 user/password's enough).

i was thinking 'bout this two ways:
a. implement the protection in my script. i need to handle cookies and stuff...
b. implement the protection through the apache-web-server with the passwd-file.

now:
1. everything (searching & administrating) is in one script, using different parameters. i'm not sure, whether i can protect only some of those parameters with apache? i think i can only use it for a whole directory?

2. can you think of another possibility for this ... challenge?

thank you guys!
m

He has: 1,380 posts

Joined: Feb 2002

if you want to protect just a certain page...you can do two things:
1- use PHP to lock the page
or
2- move the page to a different (new) directory and use .htaccess to password protect it

Brian Farkas's picture

They have: 1,015 posts

Joined: Apr 1999

Merlin-
You're correct, apache will only protect a certain file/directory. If the two subroutines are in the same file, you'll need to implement a protection scheme within the script itself.

merlin's picture

They have: 410 posts

Joined: Oct 1999

thank you brian. that's exactly what i wasn't sure about.

well, this takes some more time to do... Cool

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.