Simple Feedback Perl Script
Search Engine Optimization Techniques
|
Search Engine Optimization for dynamic pages
|
Free Perl CGI scripts
|
Online Test Engine
#!/usr/bin/perl ##################################################### # Script by MP.Prakash R.Lewis # # http://www.bestnetcraft.com # # This script is offered in the same terms as Perl. # # Inclusion of this copyright message is mandatory # # for using this script. # # Comments and suggestions may be sent through # # http://www.bestnetcraft.com/contact.html # # No liability or damage will be accepted by the # # author under any circumstances. # ##################################################### # To be called by the form page feedback.html # Check out the Readme File # Configuration - User defined variables $MAIL_PROGRAM="/usr/sbin/sendmail -t"; $diro="/user"; # Location of the log file $self_id="yourname\@your_server.com"; #Your email_id # end of userdefined variables - Do NOT modify after this line read(STDIN,$temp,$ENV{'CONTENT_LENGTH'}); @pairs=split(/&/,$temp); foreach $item(@pairs) { ($key,$content)=split(/=/,$item,2); $content=~tr/+/ /; $content=~s/%(..)/pack("c",hex($1))/ge; $content =~ s///g; $fields{$key}=$content; $i++; $item{$i}=$key; $response{$i}=$content; } #check for validity &nyet('NAME') unless ($fields{'NAME'}); &nyet('EMAIL') unless ($fields{'EMAIL'} =~ /.+\@.+/); &nyet('MSG') unless ($fields{'MSG'}); &sendemail; &thanks; sub nyet { print "Content-type: text/html\n\n"; print <
Error in Information
endo print "Apparently you have not entered the information in full. Check the $_[0] field ! Use your browser's back button to try again!\n"; die "Something is wrong with the $_[0] field.\n"; } sub thanks { open (ML,">>$diro/mail.log"); flock ML, 2; print ML "$fields{'NAME'}\n"; print ML "$fields{'EMAIL'}\n"; print ML "$ENV{'REMOTE_ADDR' }\n"; flock ML, 8; close(ML); # thank the user at his browser print "Content-type: text/html\n\n"; print <
Thanks !
Hi $fields{'NAME'},
Thanks !
Your message has been communicated. We appreciate your interest! You will receieve a reply for your feedback soon.
eof } #sendemail sub sendemail { open (MAIL_RECIP, "|$MAIL_PROGRAM"); print MAIL_RECIP <
include("footer.html");?>