#!/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 }
In reply to su to user in a cgi script by zentara
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |