Does anyone know how a redirect code would look, if I wanted a cgi script that sends the mail then goes to another page?
I already made the CGI script
here is some of the script itself(I put part of it so no one can use the script)
(I just want to add the redirection part to the bottom at the elsif[/] part it is in quote
print MAIL " -------------------------------------------------------\n";
print MAIL " The following form was sent by: $FORM{'name'}\n";
print MAIL " on $date\n\n";
print MAIL " -------------------------------------------------------\n\n";
foreach $key (keys(%FORM)) {
print MAIL "$key : $FORM{$key}\n\n";
}
close(MAIL);
###########################################
print "$thanx";
}
elsif ($Choice eq "2") {
print "HTTP/1.0 302 Temporary Redirection\r\n" if $ENV{PERLXS} eq "PerlIS";
print "(Location: \"http://nytesoft.hypermart.net\"\n\n)";
}
elsif ($Choice eq "3") {
print "$thanx2";
}
exit;##########################################
#DONE! You don't need to edit anything below.
##########################################
sub dienice {
($errmsg) = @_;
print "<center><font color=\"000080\"><b><h2>Houston, we have a problem.</h2></b></center></font>\n";
print "$errmsg<p>\n";
print "</body></html>\n";
exit;
}
------------------
Patrick Chukwura
http://nytesoft.hypermart.net
I already made the CGI script
here is some of the script itself(I put part of it so no one can use the script)
(I just want to add the redirection part to the bottom at the elsif[/] part it is in quote
Code:
print MAIL "Subject: $subject\n\n"; print MAIL " -------------------------------------------------------\n";
print MAIL " The following form was sent by: $FORM{'name'}\n";
print MAIL " on $date\n\n";
print MAIL " -------------------------------------------------------\n\n";
foreach $key (keys(%FORM)) {
print MAIL "$key : $FORM{$key}\n\n";
}
close(MAIL);
###########################################
Quote:
if ($Choice eq "1") { print "$thanx";
}
elsif ($Choice eq "2") {
print "HTTP/1.0 302 Temporary Redirection\r\n" if $ENV{PERLXS} eq "PerlIS";
print "(Location: \"http://nytesoft.hypermart.net\"\n\n)";
}
elsif ($Choice eq "3") {
print "$thanx2";
}
exit;
#DONE! You don't need to edit anything below.
##########################################
sub dienice {
($errmsg) = @_;
print "<center><font color=\"000080\"><b><h2>Houston, we have a problem.</h2></b></center></font>\n";
print "$errmsg<p>\n";
print "</body></html>\n";
exit;
}
------------------
Patrick Chukwura
http://nytesoft.hypermart.net