in reply to Sticky Forms
#!/usr/bin/perl -w use strict; use CGI (); my $q = CGI->new(); # Your logic here. print <<EOF; <html><body> <form name="form1" action="form.pl" method="POST"> EOF print q~ Username: <input type="text" name="user_name" value="@{[ HTMLEncode( $q->param('user_name') ) ]}" > <br> Password: <input type="text" name="user_password" value="@{[ HTMLEncode( $q->param('user_password') ) ]}" > <br> <input type="submit" value="Submit"> ~; print <<EOF; </form> </body> </html> EOF #========================================================== sub HTMLEncode { my ($str) = @_; $str =~ s/&/&/g; $str =~ s/"/"/g; $str =~ s/</</g; $str =~ s/>/>/g; return $str; }# end HTMLEncode()
|
|---|