in reply to Detecting a post via cgi
2) use module CGI:if($ENV{'REQUEST_METHOD'} eq 'GET') { $query=$ENV{'QUERY_STRING'} } elsif($ENV{'REQUEST_METHOD'} eq 'POST') { sysread STDIN,$query,$ENV{' +CONTENT_LENGTH'} } else { print 'Unsupport method: '.$ENV{'REQUEST_METHOD'}.'!!!'; }
3) Embperl keeps all passed data into hash %fdat, and it doesn't matter what method is used in your form.use CGI; my $q = CGI->new(); if(defined $q->param('submit')) { my $user = $q->param('user_name'); my $pass = $q->param('user_password'); } else { print "Content-type: text/html\n\n"; print <<END; <table> <form method='POST'> <tr><td>User name:</td><td><input type='text' name='user_name' +></td></tr> <tr><td>Password:</td><td><input type='password' name='user_pa +ssword'></td></tr> <tr><td colspan=2><input type='submit' name='submit' value=' L +ogin '></td></tr> </form> </table> END }
--------------------------------
SV* sv_bless(SV* sv, HV* stash);
|
|---|