PrOpHeT
02-12-2002, 03:19 PM
I have seen there are two post in the last 60 days in the perl forum, so forgive me for asking here, if there are any perl wizzes out there could you please email me
gmoody@advnetworksys.com
I have a vexing question, that I have yet to find an answer for.
ChiefRedBull
02-12-2002, 05:01 PM
Post your question here. You never know, someone might read it and have an idea.
PrOpHeT
02-13-2002, 01:34 PM
Here goes, I know I posted this originaly out of forum, but this one didnt seem to get very much trafic. Sorry
The question is....
I have a simple mail script, using blat and perl it is as follows
#!Z:\Perl\bin\perl.exe
use CGI;
use strict;
use CGI qw(:standard);
### System Vars
my $q = new CGI;
# Very important for CGI scripts
$| =1;
# Generate a 3 digit random number so that multiple files can be created.
my $iRandom = int(rand(999)) + 1;
#Must be full path to Blat Mailer
my $Mailer = "C:/WINNT/System32/blat.exe";
# You can also specfiy a path to store the random files:
# Remember IUSER must have Write privs to that folder.
# Example:
#my $fRandomFile = "c:/temp/TempMF" . $iRandom . ".txt";
my $fRandomFile = "C:/temp/TempMF" . $iRandom . ".txt";
my $SENDMAILTO = "gmoody\@advnetworksys.com";
my $SUBJECT = "WEB SITE RESPONSE";
my $SENDEREMAIL = 'email';
my $MESSAGESUBJECT = 'subject';
my $SENDERNAME = 'name';
my $SENDERCOMPANY = 'company';
my $SENDERPHONE = 'phone';
my $SENDEREMAIL = 'email';
my $MESSAGEBODY = 'comments';
### End System Vars
# must make sure this succeeds!
if (open OUT, ">$fRandomFile") {
print OUT "To: ", $SENDMAILTO, "\n";
print OUT "From: ", $q->param($SENDERNAME), " <", $q->param($SENDEREMAIL), ">", "\n";
print OUT "subject: ", " ", "WEB SITE RESPONSE", "\n";
print OUT "WEB SITE RESPONSE", "\n";
print OUT "\n";
print OUT "NAME:", " ", $q->param($SENDERNAME), "\n";
print OUT "COMPANY:", " ", $q->param($SENDERCOMPANY), "\n";
print OUT "PHONE:", " ", $q->param($SENDERPHONE), "\n";
print OUT "EMAIL:", " ", $q->param($SENDEREMAIL), "\n";
print OUT "COMMENTS:", " ", $q->param($MESSAGEBODY), ">";
close OUT;
# Generate Mailer Command Line
my $commandline = "$Mailer $fRandomFile -t $SENDMAILTO -s \"$SUBJECT\"";
# Debug
#print $commandline;
system ($commandline);
unlink ($fRandomFile);
}
else {
print "Error Sending Mail.";
}
print redirect('http://www.advnetworksys.com/flash/thanks.html');
exit;
The mail portion works fine but the redirect yields...
Try number 1 of 5.
Status: 302 Moved
location: http://www.advnetworksys.com/flash/thanks.html
the url is valid if typed directly in the browser.
Try doing this way....It worked for me...
print "Location:http://<url>/\n\n";
That is what the redirect looks like it is doing from the error ..but try it anyway
regards
jdc
PrOpHeT
02-14-2002, 02:51 PM
No Go, still will not redirect. Any clues?