Tell A Friend 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. # ##################################################### # Check out the Readme File # Sends email messages to friends of your website visitors # after the thanks message will take your visitor to this page - ipred # Configuration - User defined variables $MAIL_PROGRAM="/usr/bin/sendmail -t"; $diro="user"; $ipred="/resource.html"; 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('Name of your Friend') unless ($fields{'TONAME'}); &nyet('Email_id of your friends') unless ($fields{'TOEMAIL'} =~ /.+\@.+/); &nyet('Message') 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/tella.log"); flock ML, 2; print ML "$fields{'NAME'}\n"; print ML "$fields{'EMAIL'}\n"; print ML "$fields{'TONAME'}\n"; print ML "$fields{'TOEMAIL'}\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 will be communicated to your friend Mr.\\Ms. $fields{'TONAME'} and we appreciate your interest!
Webmaster,
eof } # sendemail sub sendemail { $bodyo =$fields{'MSG'}; open (MAIL_RECIP, "|$MAIL_PROGRAM"); print MAIL_RECIP <
$fields{'NAME'} 's Recommandation
Dear $fields{'TONAME'},
I happened to visit a website which elaborates about the fine crafts of the Net. It has free CGI,Perl scripts and ebooks for downloading. Feel free to explore Bestnetcraft.
$bodyo
Regards,
$fields{'NAME'}
eof close(MAIL_RECIP); }
include("footer.html");?>