in reply to Printing output of perl cgi to a file
The "user name" of the person at the computer running the browser is not available by default, inside a server CGI program.
If you need that, some sort of authentication or login process is required, that will capture ans store that information.
Instead, you way want to use some easily available information, like the IP address of the client.
CGI's remote_host() and remote_addr() are the best ways of getting that. You could try the remote_user() method, if you enable authentication.
Your code:
expects the user name to come in via a query string. It would be unusual if this was required to be sent with every page the user visited.my $user = $q->param('user_id')
What is the sound of Perl? Is it not the sound of a wall that people have stopped banging their heads against?
-Larry Wall, 1992
|
|---|