zentara has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use CGI 'cgi'; print "Content-type: text/html\n\n"; my $cgi= new CGI; my %input= $cgi -> Vars(); $user= $input{'user'}; $pass= $input{'password'}; $action= $input{'action'}; my $username = getpwuid $<; if ($action eq 'Click to Send'){ print "You were $username<br>"; # ##### stumped here ################## # print "You are now $username<br>"; }else{ print<<EOHTML; <form action="http://localhost/~zentara/cgi-bin/su.cgi"> You are now $username<br><br> <b>Name: </b> <input type="text" name="user" size=30><br> <b>Password: </b> <input type="password" name="password" size=30><br> <input type="submit" name="action" value="Click to Send"> </form> EOHTML }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: su to user in a cgi script
by Preceptor (Deacon) on Sep 20, 2002 at 18:47 UTC | |
|
Re: su to user in a cgi script
by zigdon (Deacon) on Sep 20, 2002 at 17:07 UTC | |
by Silicon Cactus (Scribe) on Sep 20, 2002 at 17:21 UTC | |
by virtualsue (Vicar) on Sep 20, 2002 at 18:04 UTC |