
ros
Novice
Mar 3, 2003, 8:33 AM
Post #3 of 10
(438 views)
|
Re: [davorg] Redirect URL as a variable
[In reply to]
|
Can't Post
|
|
Hmm, Tried that (with and without the path to the SSL) Sorry I must be a bit dozy here?? Any ideas?? here's a bit more of the script: print "<INPUT TYPE=HIDDEN NAME='taxrate' VALUE=$FORM{taxrate}>"; print "<INPUT TYPE=HIDDEN NAME='shipcharge' VALUE=$FORM{shipcharge}>"; print "<INPUT TYPE=hidden NAME=bag Value='$FORM{bag}'>"; print "<INPUT TYPE='image' NAME='Send Order' BORDER=0 SRC='pay.gif'></FORM>"; print "<font size=5 color='red'>Upon completion of your payment, you will be able to enter your car advert</font>\n"; #######the value of $number is retained but dumps into bag ### Print footer HTML. open(FOOTER, "footer3.html"); print <FOOTER>; close(FOOTER); } else { ### Write order to file $ordernum = time; my $time = localtime(time()); $time =~s/\s+/_/g; $filename = "$time.txt"; open(SECURE, "|/usr/local/bin/encryptit.pl $user>/path/$user/$filename"); print SECURE "ORDER NO. $ordernum\n\n"; print SECURE "ORDER DATE: $mydate\n\n"; print SECURE "Qty \tItem \tDescription \t \t \t Price\t Subtotal\n"; $total = 0; foreach $item (@cart) { ($quantity,$number,$desc,$color,$size,$price) = split(/\|/, $item); $quantity= $quantity." "; $number= $number." "; $desc= $desc." "; $subtotal = $price*$quantity; $total = $total + $subtotal; $a = sprintf("%-4.4s\t", $quantity); $b = sprintf("%-10.10s\t", $number); $c = sprintf("%-40.40s\t", $desc); $d = sprintf("%-10.10s\t", $color); $e = sprintf("%-5.5s\t", $size); $f = sprintf("%10.2f\t", $price); $g = sprintf("%10.2f", $subtotal); print SECURE "$a$b$c$d$e$f$g\n"; } print SECURE "\nTax Rate: $FORM{taxrate} % \n"; $tax = $total * ($FORM{taxrate}/100); $ptax = sprintf("Tax: %5.2f", $tax); print SECURE "$ptax\n"; $total = $total + $tax; $pship = sprintf("S&H: %5.2f", $FORM{shipcharge}); print SECURE "$pship\n"; $total = $total + $FORM{shipcharge}; $totl = sprintf("TOTAL: %5.2f", $total); print SECURE "$totl\n\n"; print SECURE "Payment Method: $FORM{'method'}\n"; if ($FORM{'method'} eq "Credit Card") { print SECURE "Credit Card: $FORM{'card'} Number: $FORM{'cardnumber'} Expires: $FORM{'expmonth'} $FORM{'expyear'}\n"; } if ($FORM{'method'} eq "Debit Card") { print SECURE "Debit Card: $FORM{'card'} Number: $FORM{'cardnumber'} Expires: $FORM{'expmonth'} $FORM{'expyear'} Issue number: $FORM{issueno}\n"; } print SECURE "\n"; print SECURE "BILLING ADDRESS:\n"; print SECURE "$FORM{'bfname'} $FORM{'blname'}\n"; print SECURE "$FORM{'badd1'}\n"; if ($FORM{'badd2'} ne "") { print SECURE "$FORM{'badd2'}\n"; } print SECURE "$FORM{'bcity'} $FORM{'bstate'} $FORM{'bzip'}\n"; print SECURE "$FORM{'bcountry'}\n"; print SECURE "$FORM{'bemail'}\n"; print SECURE "Phone: $FORM{'bphone'}\n"; print SECURE "Fax: $FORM{'bfax'}\n\n"; print SECURE "COMMENTS\n"; print SECURE "$FORM{'comments'}\n"; print SECURE "-----------------------------------------------------------\n"; print SECURE "Remote IP address: $ENV{'REMOTE_ADDR'}\n"; close(SECURE); ### email notification of order $to = $mymail; $from = $mymail; $reply = $mymail; $smtp = $mysmtp; $subject = 'Order Notification'; $message = "Filename: $filename\n"; $status = sendmail($from, $reply, $to, $smtp, $subject, $message ); ### E-mail results to purchaser. if ( $FORM{'bemail'} =~/\@/) { $to = $FORM{'bemail'}; $smtp = $mysmtp; $subject = 'Order Confirmation'; $from = $mymail; $reply = $mymail; $message = "Content-type: text/html\n\n"; $message = $message."ORDER NO. $ordernum\n\n"; $message = $message."Thank You! This is to confirm we will debit your card as follows your order as follows:\n\n"; $message = $message."Qty \tItem \tDescription \t \t \t Price\t Subtotal\n"; $total = 0; foreach $item (@cart) { ($quantity,$number,$desc,$color,$size,$price) = split(/\|/, $item); $quantity= $quantity." "; $number= $number." "; $desc= $desc." "; $subtotal = $price*$quantity; $total = $total + $subtotal; $a = sprintf("%-4.4s\t", $quantity); $b = sprintf("%-10.10s\t", $number); $c = sprintf("%-40.40s\t", $desc); $d = sprintf("%-10.10s\t", $color); $e = sprintf("%-5.5s\t", $size); $f = sprintf("%10.2f\t", $price); $g = sprintf("%10.2f", $subtotal); $message = $message."$a$b$c$d$e$f$g\n"; } $message = $message."\nTax Rate: $FORM{taxrate} % \n"; $tax = $total * ($FORM{taxrate}/100); $ptax = sprintf("Tax: %5.2f", $tax); $message = $message."$ptax\n"; $total = $total + $tax; $pship = sprintf("S&H: %5.2f", $FORM{shipcharge}); $message = $message."$pship\n"; $total = $total + $FORM{shipcharge}; $totl = sprintf("TOTAL: %5.2f", $total); $message = $message."$totl\n\n"; $message = $message."Payment Method: $FORM{'method'}\n"; $message = $message."\n"; $message = $message."BILLING ADDRESS:\n"; $message = $message."$FORM{'bfname'} $FORM{'blname'}\n"; $message = $message."$FORM{'badd1'}\n"; if ($FORM{'badd2'} ne "") { $message = $message."$FORM{'badd2'}\n"; } $message = $message."$FORM{'bcity'} $FORM{'bstate'} $FORM{'bzip'}\n"; $message = $message."$FORM{'bcountry'}\n"; $message = $message."$FORM{'bemail'}\n"; $message = $message."Phone: $FORM{'bphone'}\n"; $message = $message."Fax: $FORM{'bfax'}\n\n"; $message = $message."COMMENTS\n"; $message = $message."$FORM{'comments'}\n"; $message = $message."-----------------------------------------------------------\n"; $status = sendmail($from, $reply, $to, $smtp, $subject, $message ); } ### Print a message to user placing the order if ($status != 1) { print "Content-type: text/html\n\n"; print "An error has occured while emailing your order<BR>"; print "Please email us and tell us you received an error code: $status<P>"; } else { ###########this is your bit################# #tried it as thankyou1.html and the fullpath my %pages = (A4 => 'https://www.secure-website.com/myname/thankyou1.html', A8 => 'https://www.secure-website.com/myname/thankyou2.html', A16 => 'https://www.secure-website.com/myname/thankyou3.html', A1 => 'https://www.secure-website.com/myname/thankyou4.html', A2 => 'https://www.secure-website.com/myname/thankyou5.html', AL => 'https://www.secure-website.com/myname/thankyou6.html', AP => 'https://www.secure-website.com/myname/thankyou7.html'); my $page = 'https://www.secure-website.com/myname/thankyou.html'; # in case $number is invalid $page = $pages{$number}; print "Content-type: text/html\n\n"; open(THANKYOU,"$page"); #is this how you call the URL? print <THANKYOU>; close(THANKYOU); } } }
|