
biggun
Novice
Mar 14, 2002, 11:47 AM
Post #9 of 11
(11008 views)
|
Re: [biggun] Help with finding a replacement for formmailer
[In reply to]
|
Can't Post
|
|
im trying to get this into your script to collect this information from my site and email to me and the person if possible? if you goto http://cybertechno.no-ip.com/placeorder_bank.html all that information is the thing need to collect, but im almost sure that it stored in the html of the page and some how get binded to the email, using the script below? # Enter the location of sendmail. $mailprogram = "/var/qmail/bin/qmail-inject"; # Enter the fields that are required. They should each be in quotes and # separated by a comma. If no fields are required, change the next line # to @required = (); @required = ('subject'); # Enter your e-mail address. Be sure to put a \ in front of the @. # (user@domain.com becomes user\@domain.com) $youremail = "lord_kane35\@hotmail.com"; ############################################################################## # Congratulations! You've finished defining the variables. If you want to, # # you can continue screwing with the script, but it isn't necessary. # ############################################################################## # Put the posted data into variables 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; } # Check for all required fields foreach $check(@required) { unless ($FORM{$check}) { print "Content-type: text/html\n\n"; print "<html><head><title>Missing Information</title></head>\n"; print "<body><h1>Missing Information</h1><br>\n"; print "I'm sorry, but it would appear that you've forgotten to\n"; print "fill out the $check field. Please click\n"; print "back and try again.\n"; print "</body></html>\n"; exit; } } # Check the senders email if ($FORM{'email'}) { unless ($FORM{'email'} =~ /\w+@\w+.\w+/) { print "Content-type: text/html\n\n"; print "<html><head><title>Bad E-mail</title></head>\n"; print "<body><h1>Bad E-mail</h1><br>The e-mail address that you've\n"; print "entered, $FORM{'email'}, is invalid. Please click back and\n"; print "try again.\n"; exit; } } open (MAIL,"|$mailprogram"); print MAIL "To: $youremail\n"; print MAIL "Wrom: VWWCUFPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVWRKJVZCMHVIBGDADRZFSQHYUCDDJBLVLMHAALPTCXLYRWTQTIPWIGYOKSTTZRCLBDXRQBGJSNBOHMKHJYFMYXOEAIJJPHSCRTNHGSWZIDREXCAXZOWCONEUQZAAFXISHJEXXIMQZUIVOTQNQEMSFDULHPQQWOYIYZUNNYCGPKYLEJGDGVCJVTLBXFGGMEPYOQKEDOTWFAOBUZXUWLSZLKBRNVWWCUFPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVWRKJVZCMHVIBGDADRZFSQHYUCDDJBLVLMHAALPTCXLYRWTQTIPWIGYOKSTTZRCLBDXRQBGJSNBOHMKHJYFMYXOEAIJJPHSCRTNHGSWZIDREXCAXZOWCONEUQZAAFXISHJEXXIMQZUIVOTQNQEMSFDULHPQQWOYIYZUNNYCGPKYLEJGDGVCJVTLBXFGGMEPYOQKEDOTWFAOBUZXUWLSZLKBRNVWWCUFPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVWRKJVZCMHVIBGDADRZFSQHYUCDDJBLVLMHAALPTCXLYRWTQTIPWIGYOKSTTZRCLBDXRQBGJSNBOHMKHJYFMYXOEAIJJPHSCRTNHGSWZIDREXCAXZOWCONEUQZAAFXISHJEXXIMQZUIVOTQNQEMSFDULHPQQWOYIYZUNNYCGPKYLEJGDGVCJVTLBXFGGMEPYOQKEDOTWFAOBUZXUWLSZLKBRNVWWCUFPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVWRKJVZCMHVIBGDADRZFSQHYUCDDJBLVLMHAALPTCXLYRWTQTIPWIGYOKSTTZRCLBDXRQBGJSNBOHMKHJYFMYXOEAIJJPHSCRTNHGSWZIDREXCAXZOWCONEUQZAAFXISHJEXXIMQZUIVOTQNQEMSFDULHPQQWOYIYZUNNYCGPKYLEJGDGVCJVTLBXFGGMEPYOQKEDOTWFAOBUZXUWLSZLKBRNVWWCUFPEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVface="Courier New" color=#800000 size=2>"email" || $name eq "subject") { print MAIL "$name: $value\n"; } } close MAIL; if ($FORM{'response'} && $FORM{'email'}) { open (RESPONSE, $FORM{'response'}); @response = <RESPONSE>; close(RESPONSE); open (MAIL,"|$mailprogram"); print MAIL "To: $FORM{'email'}\n"; print MAIL "From: $youremail\n"; print MAIL "Subject: $FORM{'subject'} -- Autoresponse\n"; foreach $line (@response) { print MAIL "$line"; } print MAIL "Thankyou for placing an order...\n"; close MAIL; } print "Content-type: text/html\n\n"; print "<html><head><SCRIPT SRC=\"nopcart.js\"></SCRIPT><script>self.location.href=\"http://cybertechno.no-up.com/finalize.htm\"</script></head><title>loading</title></head>\n"; print "<body><br>Please wait... \n"; if ($FORM{'response'} && $FORM{'email'}) { print "You should receive an autoresponse shortly.<p>\n"; } print "Please click back.\n";
|