![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| check user id before running script | cpolikowsky | UNIX for Dummies Questions & Answers | 3 | 06-06-2008 09:02 AM |
| AIX:creating user with username more than 8 chars | anuafs84 | UNIX for Dummies Questions & Answers | 0 | 04-14-2007 01:00 AM |
| find the server name a script is running on | shellburger | UNIX for Dummies Questions & Answers | 3 | 08-30-2006 08:15 PM |
| Running script from other user rather than login user | rawatds | Shell Programming and Scripting | 2 | 08-25-2006 12:51 AM |
| running a script under different user | Gary Dunn | Shell Programming and Scripting | 4 | 12-13-2004 02:17 PM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Find username of user running the script
Hello All,
If I have a simple cgi script and want to find the name of the person accessing the page, is it possible? How do I get the name of this user? Please help. I was trying a vague method but it doesn't seem to work with all browsers and versions ... Code:
$val=$ENV{'HTTP_COOKIE'};
$name = (split ('=',(split(';',$val))[1]))[1];
print "$name";
garric Last edited by Yogesh Sawant; 06-09-2008 at 04:01 AM. Reason: added code tags |
| Forum Sponsor | ||
|
|
|
|||
|
This information is not transmitted over HTTP/CGI. If you mean the local user executing the CGI script on behalf of the visitor, then that should be whatever user is running the HTTP daemon, and will not change from one invocation to the next.
If you are setting cookies, then whatever is in those cookies is of course accessible to you, but if you don't know a user in the first place, you cannot get their name into a cookie. |
|||
| Google UNIX.COM |
| Thread Tools | |
| Display Modes | |
|
|