#!/usr/local/bin/perl ################################################## ## formmail.cgi (C)2002 Milana Leshinsky ## ################################################## ## ## ## http://www.helpingfoot.com ## ## http://www.installcgi.com ## ## ## ## COPYRIGHT NOTICE: ## ## ## ## Copyright 2002 Milana Leshinsky. ## ## All Rights Reserved. ## ## ## ## For help on installing CGI scripts, get a ## ## "How To Install & Troubleshoot CGI Scripts" ## ## tutorial at http://www.installcgi.com ## ## ## ## Selling the code for this program ## ## without prior written consent is expressly ## ## forbidden. Obtain permission before ## ## redistributing this program over the ## ## Internet or in any other medium. ## ## ## ## Modification to the code are permitted ## ## as long as the modified code is not sold ## ## or redistributed without prior written ## ## consent. In all cases copyright and header ## ## must remain intact. ## ## ## ## All violators will be prosecuted. ## ## ## ## This program is distributed "as is" and ## ## without warranty of any kind, either express ## ## or implied. In no event ## ## shall the liability of Milana Leshinsky for ## ## any damages, losses and/or causes of action ## ## exceed the total amount paid by the user for ## ## this script. ## ## ## ################################################## ################################################## ## Do you need this form to be customized? ## ################################################## ## ## ## I would be happy to modify this form to your ## ## specifications for a fee. Here is how I ## ## can customize this form script for you: ## ## ## ## ## ## - change, remove, or add form questions ## ## - modify colors to match your web site ## ## - make certain answers required ## ## - record all responses in a text file so ## ## you could access it later ## ## - change the e-mail message you or your ## ## visitors receive ## ## - anything else you want changed ## ## ## ## Contact milana@installcgi.com to request a ## ## quote. ## ## ## ################################################## ########## ---- MODIFY VARIABLES $mailprogram = '/usr/sbin/sendmail'; # Location of your sendmail program. $my_email = 'micropersian@yahoo.com'; # Where you want the messages to go to $homepage = 'http://www.ketabkhaneh.i8.com'; # URL of your home page $website_name = 'Www.ketabkhaneh.i8.coM'; # Your web site's name $subject='moarefi ketab az ketabkhaneh'; # The subject of your e-mail message to your visitor $thankyou_message='We will reply as soon as we can!'; # E-mail message text your visitors will receive $thankyou_page='We will reply as soon as we can!'; # Text your visitor will see on a thank-you page $logo_url='http://www.ketabkhaneh.netfirms.com/sendmail.JPG'; # URL of your logo or image to display ########## --- DO NOT CHANGE ANYTHING BELOW read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } if ($FORM{'email'}) { $email = $FORM{'email'}; } if ($FORM{'email'} eq "") { print "Content-type: text/html\n\n"; print "Sorry! Your E-Mail Is Missing!\n"; print "

Sorry! Your E-Mail Is Missing!

\n"; print "
Please, click your Back button and try again!
"; print "

Need a FREE form for your web site? Get it at "; print "HelpingFoot.com

\n"; print "\n"; exit; } # Sending message to your address open (MAIL,"|$mailprogram -t"); print MAIL "To: $my_email\n"; print MAIL "From: $email\n"; print MAIL "Subject: $subject\n"; print MAIL "Your web site visitor has submitted this information:\n\n"; @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; print MAIL "$name: $value\n"; } close(MAIL); # Sending message to your visitor open (MAIL,"|$mailprogram -t"); print MAIL "To: $email\n"; print MAIL "From: $my_email\n"; print MAIL "Subject: Re\: $subject\n"; print MAIL "Thank you for contacting us!\n\n"; print MAIL $thankyou_message; print MAIL "\n\n"; print MAIL "Here is the information you submitted:\n\n"; @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; print MAIL "$name: $value\n"; } close(MAIL); # Print thank-you page print "Content-type: text/html\n\n"; print "Thank-you - E-mail Sent\n"; print "
"; print "
Thank You!
"; print $thankyou_page; print "

"; print "

"; print "Return To $website_name"; print "


Need a FREE form for your web site? Get it at "; print "HelpingFoot.com


"; print "
"; ## IMPORTANT: Removal of the link to HelpingFoot.com violates your user agreement. Do not remove, please.