Posted on 2006-06-04
I’m not sure if this is the right section to post in, but here goes…
I’m setting up a website where I want a user to log-in and at his leisure complete various surveys/experiments (behavioral research). My goal is to have a one-time registration page that sets up a user account and then allow the user to login with a uid/pwd. This much I can handle.
Next I want the user, once logged in, to complete surveys (which I will write in Perl) and have the data stored. This I can also handle.
The part that I can’t figure out how to do, is to link the log-in with the various Perl scripts. Originally I was thinking that when the user logs in a temp file could be created on the server with his uid which the various Perl scripts would read and append to the data being stored. This, however, I realize is a problem when multiple users log in at once (though if there is an easy solution to this, I’m all ears). Next I thought maybe I could use the .htaccess login “system” to track the user, but I have no clue how to extract the userid associated with the login with a Perl script. I think ideally, this would be the solution I want, but I’m all ears for anything else.
I also realize that I could just constantly pass the user info from Perl script to Perl script, but this gets VERY messy.
So my specific questions are as follows:
1) Is there a way to have a Perl script “read” the user information once a user logs into a folder that is “protected” by an .htaccess level login system?
2) Is there a better/different way to track a user throughout his access?
Thanks for the help!
Apache version – 1.3.36 (unix)
Perl version – 5.8.7
MySQL (if needed) version – 4.1.19-standard