stuck at checkout

Problems installing or using the NOP Design Free Shopping Cart. **ARCHIVE** Please post new topics to one of the groups below.

Moderator: scott

stuck at checkout

Postby justin » Sat Dec 07, 2002 5:35 pm

I'm get all the way to the final checkout but can't seem to get the cgi to run. I press the checkout button and it deos nothing. Anyone help?

<FORM METHOD="POST" ACTION="/cgi-bin/checkout.pl">
</form>
<INPUT TYPE="HIDDEN" NAME="required"
VALUE="firstname,lastname,email">
<INPUT TYPE="HIDDEN" NAME="sort"
VALUE="order:ID_1,NAME_1,PRICE_1,QUANTITY_1,ID_2,NAME_2,PRICE_2,QUANTITY_2,ID_3,NAME_3,PRICE_3,QUANTITY_3,SUBTOTAL,SHIPPING,TAX,TOTAL,creditcard,card-name,card-number1st,card-number2nd,card-number3rd,card-number4th,3-digit-code,exp-date,firstname,lastname,e-mail">
<INPUT TYPE="HIDDEN" NAME="recipient" VALUE="hurleyjs@yahoo.com">
<INPUT TYPE="HIDDEN" NAME="hide_blanks" VALUE=1>
<INPUT TYPE="HIDDEN" NAME="subject" VALUE="Online Order Form">
<INPUT TYPE="HIDDEN" NAME="font_size" VALUE="2">
<INPUT TYPE="HIDDEN" NAME="font_face" VALUE="arial,helvetica,verdana">
<INPUT TYPE="HIDDEN" NAME="background" VALUE="/images/line1.gif">
<input type=hidden name="env_report" value="HTTP_USER_AGENT">
<SCRIPT> CheckoutCart(); </SCRIPT>
justin
 
Posts: 53
Joined: Fri Nov 29, 2002 4:35 pm
Location: UK

Postby scott » Sun Dec 08, 2002 4:21 am

Look at your first couple lines closer:

<FORM METHOD="POST" ACTION="/cgi-bin/checkout.pl">
</form>

You end the form before you do anything :-) I don't believe that's what you want... You need to have the </FORM> after all the input fields, text fields, and CheckoutCart() call.

_Scott
scott
Site Admin
 
Posts: 558
Joined: Sun Jul 14, 2002 7:00 pm
Location: Phoenix, AZ

Postby justin » Sun Dec 08, 2002 11:54 am

Thanks Scott, I admire the wealth of info and experience you so free willingly give. A big hats off to you bruva, and I hope you have a wicked one over xmas.

The form tag you were refering to keeps being inserted by frontpage, I'm going back to the start with your sample site checkout and building it up from there. I was running before I could walk.

I get the checkout.pl script running a dream over a normal http connection, but I can't get it to run over a secure ssl https connection, any ideas what I'm doing wrong?

unsecure connection = /cgi-bin/checkout.pl - works fine.
secure = https://host3.ipowerweb.com/~bishopli/c ... heckout.pl - not working.
justin
 
Posts: 53
Joined: Fri Nov 29, 2002 4:35 pm
Location: UK

Postby scott » Tue Dec 10, 2002 9:42 pm

host3.ipowerweb.com doesn't seem to be a valid server.

-Scott
scott
Site Admin
 
Posts: 558
Joined: Sun Jul 14, 2002 7:00 pm
Location: Phoenix, AZ

Postby justin » Thu Dec 12, 2002 4:41 pm

Sorry scott typing mistake, host31 not host3.
Use index.htm to access a test model of your cart I'm trying to implement.
It's the checkout page (orderform) that I'm having problems with FP keeps inserting a form tag. Checkout and clear form are not working.
justin
 
Posts: 53
Joined: Fri Nov 29, 2002 4:35 pm
Location: UK

Postby justin » Thu Dec 12, 2002 6:56 pm

--------------------------------------------------------------------------------------------------------
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, support@ipowerweb.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.


Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
--------------------------------------------------------------------------------------------------------

I'm sure I'm getting this message because of a problem with the checkout.pl matching form fields of the checkout page, can you see anything I'm doing wrong.

html - checkout page
--------------------------

<HTML>
<HEAD>
<SCRIPT SRC="nopcart.js"> </SCRIPT>

</HEAD>
<BODY BGCOLOR="White" TEXT="Black">

<FONT CLASS="checkout">
<form action="cgi-bin/checkout.pl" method="POST" onSubmit="return CheckForm(this)">
<NOBR>
<SCRIPT>
CheckoutCart();
</SCRIPT>
</NOBR>
&nbsp;<p>&nbsp;</p>
<p>
<b><font class="greetext">Billing Information:</font></b></p>
<P>

<TABLE class="blacktext">
<TR><TD>Credit Card:</TD><TD><input type="radio" value="Visa" name="creditcard">
Visa <input type="radio" name="creditcard" value="mastercard">Mastercard
<input type="radio" name="creditcard" value="Switch">Switch</TD></TR>
<TR><TD>Name on Card:</TD><TD><input type="text" name="card-name" size="20"></TD></TR>
<TR><TD>Card Number:</TD><TD><input type="text" name="card-number1st" size="4">
<input type="text" name="card-number2nd" size="4">
<input type="text" name="card-number3rd" size="4">
<input type="text" name="card-number4th" size="4"></TD></TR>
<TR><TD>3 Digit Code:</TD><TD><input type="text" name="3-digit-code" size="4"></TD></TR>
<TR><TD>Expiry Date:</TD><TD><input type="text" name="exp-date" size="9"></TD></TR>
<TR><TD>Name: </TD><TD><input type="text" size="18" name="firstname">
<input type="text" size="15" name="lastname"></TD></TR>
<TR><TD>Address: </TD><TD><input type="text" size="37" name="address"> </TD></TR>
<TR><TD>City: </TD><TD><input type="text" size="21" name="city"> </TD></TR>
<TR><TD>Town: </TD><TD><input type="text" size="15" name="town"> </TD></TR>
<TR><TD>Post Code: </TD><TD><input type="text" size="8" name="post-code"></TD></TR>
<TR><TD>Phone: </TD><TD><input type="text" size="37" name="phone"></TD></TR>
<TR><TD>Fax: </TD><TD><input type="text" size="37" name="fax"></TD></TR>
<TR><TD>Email: </TD><TD><input type="text" size="37" name="email"> </TD></TR>
</TABLE>
<p>
<b>Shipping Information (if different than billing):</font></b><P>
<TABLE class="blacktext">
<TR><TD>Name: </TD><TD><input type="text" size="18" name="ship-firstname">
<input type="text" size="15" name="ship-lastname"></TD></TR>
<TR><TD>Address: </TD><TD><input type="text" size="37" name="ship-address"> </TD></TR>
<TR><TD>City: </TD><TD><input type="text" size="21" name="ship-city"> </TD></TR>
<TR><TD>Town: </TD><TD><input type="text" size="15" name="ship-town"> </TD></TR>
<TR><TD>Post Code: </TD><TD><input type="text" size="8" name="ship-post-code"></TD></TR>

</TABLE>

<TEXTAREA NAME="comment" ROWS=6 COLS=40>
</TEXTAREA>
</font>
<P>
<input type=submit Value="Submit Order"> <INPUT type=RESET value=" Clear Form ">
</p>
</center>
</FORM>
</body>
</html>


checkout.pl
--------------------------
#!/usr/bin/perl
#=====================================================================||
# NOP Design JavaScript Shopping Cart ||
# PERL CGI Checkout Module ||
# ||
# For more information on SmartSystems, or how NOPDesign can help you ||
# Please visit us on the WWW at http://www.nopdesign.com ||
# ||
# Javascript portions of this shopping cart software are available as ||
# freeware from NOP Design. You must keep this comment unchanged in ||
# your code. For more information contact FreeCart@NopDesign.com. ||
# ||
# JavaScript Shop Module, V.4.3.0 ||
#=====================================================================||
# ||
# Function: Writes available form elements from the NOP ||
# Free Cart (http://www.nopdesign.com/freecart) ||
# and other form elements to an email file, and ||
# send user confirmation ||
# ||
#=====================================================================||
require 5.001;

########################################################################
# #
# User defined variables: #
# $header - string value containing the complete #
# path of the HTML page header #
# $footer - string value containing the complete #
# path of the HTML page footer #
# $mailprogram - string value containing the complete path to #
# the sendmail binary on the system. #
# $youremail - string value containing the email address to #
# send catalog orders in EMAIL or BOTH modes #
# **Don't forget to put a \ before the @ in your #
# email address. ie. spam\@nopdesign.com*** #
# $returnpage - URL to send user when checkout is complete #
# $csvfilename - string value containing the complete #
# path of the user database. #
# $csvquote - string value containing what to use for quotes #
# in the csv file (typically "" or \") #
# $mode - string value containing 'EMAIL', 'FILE' or #
# 'BOTH' to determine if the script should send #
# an email to you with the new order, write the #
# order to a CSV file, or do both. #
########################################################################
$header = "header.html";
$footer = "footer.html";
$mailprogram = "/usr/lib/sendmail -t";
$returnpage = "/";
$youremail = "hurleyjs\@yahoo.com";
$csvfilename = "orders.csv";
$csvquote = "\"\"";
$mode = "BOTH";


#These are required fields. I recommend enforcing these by javascript,
#but let's just make sure here as well.
@required = (
'creditcard',
'card-name',
'card-number1st',
'card-number2nd',
'card-number3rd',
'card-number4th',
'3-digit-code',
'exp-date',
'firstname',
'lastname',
'address',
'city',
'town',
'post-code',
'phone',
'email'
);

##############################################################
#FUNCTION: urlDecode #
#RETURNS: The decoded string. #
#PARAMETERS: An encoded string. #
#PURPOSE: Decodes a URL encoded string. #
##############################################################
sub urlDecode {
my ($string) = @_;
$string =~ tr/+/ /;
$string =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex($1))/eg;
$string =~ s/['"]/\'/g;
return ($string);
}

##############################################################
#FUNCTION: processCGI #
#RETURNS: #
#PARAMETERS: #
#PURPOSE: Retrieves form data submitted via the 'GET' #
# method and decodes it. You may then access #
# the passed in variables via calls to $[name] #
# where [name] is the name of the form element. #
##############################################################
sub processCGI {
local ($cgiData, $key, $value, $pair, @pairs);

if ($ENV{'REQUEST_METHOD'} eq 'GET') { $cgiData = $ENV{'QUERY_STRING'}; }
else { $cgiData = <STDIN>; }
@pairs = split (/&/, $cgiData);
foreach $pair (@pairs) {
($key, $value) = split (/\=/, $pair);
$key = &urlDecode($key);
$value = &urlDecode($value);
if(defined ${$key}){
${$key} .= ", ".$value;
}else{
${$key} = $value;
}
}
}

##############################################################
#FUNCTION: doFormError #
#RETURNS: #
#PARAMETERS: A error message string. #
#PURPOSE: Generates an HTML page indicating a form #
# submission error occurred. #
##############################################################
sub doFormError {
my ($errString) = @_;

open (HEAD, $header);
@LINES = <HEAD>;
close HEAD;

print "Content-type: text/html\n\n";

print @LINES;

print "<FONT SIZE=+2>The form you submitted was not complete.<BR><BR></FONT>";
print "$errString<BR><BR>\n";
print "<INPUT TYPE=BUTTON ONCLICK='history.back()' VALUE=' Return to the checkout page '><HR>";

open (FOOT, $footer);
@LINES = <FOOT>;
close FOOT;
print @LINES;

exit;
}

##############################################################
#FUNCTION: doError #
#RETURNS: #
#PARAMETERS: A error message string. #
#PURPOSE: Generates an HTML page indicating an error #
# occurred. #
##############################################################
sub doError {
my ($errString) = @_;
print "Content-type: text/html\n\n";

open (HEAD, $header);
@LINES = <HEAD>;
close HEAD;

print @LINES;

print "$errString<BR><BR>\n";

open (FOOT, $footer);
@LINES = <FOOT>;
close FOOT;
print @LINES;

exit;
}

##############################################################
#FUNCTION: invalidE #
#RETURNS: 1 if invalid, 0 if valid. #
#PARAMETERS: An email address variable. #
#PURPOSE: Checks to see if a submitted email address is #
# of the valid form 'x@y'. #
##############################################################
sub invalidE {
my ($szEmail) = @_;
my ($user, $host);

$szEmail =~ tr/A-Z/a-z/;
if ($szEmail =~ /\s/) { return 1; }
($user, $host) = split (/\@/, $szEmail);
if ($host =~ /compuserve/i) { ; }
else {
if (! $user =~ /\D/) { return 1; }
if (! $host =~ /\D/) { return 1; }
if (substr ($user,0,1) !~ /[a-z]/) { return 1; }
}
if ($szEmail =~ /\w+\@[\w|\.]/) { return 0; }
else { return 1; }
}


sub populateDateVar {
@months = ();
push(@months,"January");
push(@months,"February");
push(@months,"March");
push(@months,"April");
push(@months,"May");
push(@months,"June");
push(@months,"July");
push(@months,"August");
push(@months,"September");
push(@months,"October");
push(@months,"November");
push(@months,"December");
@days = ();
push(@days,"Sunday");
push(@days,"Monday");
push(@days,"Tuesday");
push(@days,"Wednesday");
push(@days,"Thursday");
push(@days,"Friday");
push(@days,"Saturday");
($sec,$min,$hour,$day,$month,$year,$day2) =
(localtime(time))[0,1,2,3,4,5,6];
if ($sec < 10) { $sec = "0$sec"; }
if ($min < 10) { $min = "0$min"; }
if ($hour < 10) { $hour = "0$hour"; }
if ($day < 10) { $day = "0$day"; }
$year += "1900";

#$todaysdate = "$months[$month] $day, $year $hour:$min:$sec";
}


##############################################################
##############################################################
### MAIN ###
##############################################################
##############################################################

# process the form input.
&processCGI;
&populateDateVar;

foreach $check(@required) {
unless ($check) {
doFormError("It appears that you forgot to fill in the <strong>$check</strong> field.");
exit;
}
}

# checks for valid email address
if( &invalidE($b_email) ){
doFormError('You submitted an invalid email address.');
}


if( $mode eq "BOTH" || $mode eq "EMAIL") {
# Send email order to you...
open (MAIL,"|$mailprogram");
print MAIL "To: $youremail";
print MAIL "From: $email\n";
print MAIL "Subject: New Online Order\n";
print MAIL "\n\n";
print MAIL "A new order has been received. A summary of this order appears below.\n";
print MAIL "\n";
print MAIL "Order Date: $months[$month] $day, $year $hour:$min:$sec \n";
print MAIL " \n";
print MAIL "Bill To: \n";
print MAIL "-------- \n";
print MAIL " $firstname $lastname \n";
print MAIL " $address \n";
print MAIL " $city, $town, $post-code \n";
print MAIL " $phone \n";
print MAIL " $fax \n";
print MAIL " $email \n";
print MAIL " \n";
print MAIL " \n";
print MAIL "Charge: \n";
print MAIL " $card-name \n";
print MAIL " $creditcard \n";
print MAIL " $card-number1st - card-number2nd - card-number3rd - card-number4th \n";
print MAIL " $3-digit-code \n";
print MAIL " $exp-date \n";
print MAIL " \n";
print MAIL " \n";
print MAIL "Ship To: \n";
print MAIL "-------- \n";
print MAIL " $ship-firstname $shiplastname \n";
print MAIL " $ship-address \n";
print MAIL " $ship-city, $ship-town $ship-post-code \n";
print MAIL " $ship-phone \n";
print MAIL " \n";
print MAIL " \n";
print MAIL "Qty Price(\$) Product ID - Product Name\n";
print MAIL "===================================================================== \n";
print MAIL "$QUANTITY_1 \$$PRICE_1 $ID_1 - $NAME_1 $ADDTLINFO_1 \n";
if( $NAME_2 ) {print MAIL "$QUANTITY_2 \$$PRICE_2 $ID_2 - $NAME_2 $ADDTLINFO_2 \n";}
if( $NAME_3 ) {print MAIL "$QUANTITY_3 \$$PRICE_3 $ID_3 - $NAME_3 $ADDTLINFO_3 \n";}
if( $NAME_4 ) {print MAIL "$QUANTITY_4 \$$PRICE_4 $ID_4 - $NAME_4 $ADDTLINFO_4 \n";}
if( $NAME_5 ) {print MAIL "$QUANTITY_5 \$$PRICE_5 $ID_5 - $NAME_5 $ADDTLINFO_5 \n";}
if( $NAME_6 ) {print MAIL "$QUANTITY_6 \$$PRICE_6 $ID_6 - $NAME_6 $ADDTLINFO_6 \n";}
if( $NAME_7 ) {print MAIL "$QUANTITY_7 \$$PRICE_7 $ID_7 - $NAME_7 $ADDTLINFO_7 \n";}
if( $NAME_8 ) {print MAIL "$QUANTITY_8 \$$PRICE_8 $ID_8 - $NAME_8 $ADDTLINFO_8 \n";}
if( $NAME_9 ) {print MAIL "$QUANTITY_9 \$$PRICE_9 $ID_9 - $NAME_9 $ADDTLINFO_9 \n";}
if( $NAME_10 ){print MAIL "$QUANTITY_10 \$$PRICE_10 $ID_10 - $NAME_10 $ADDTLINFO_10 \n";}
if( $NAME_11 ){print MAIL "$QUANTITY_11 \$$PRICE_11 $ID_11 - $NAME_11 $ADDTLINFO_11 \n";}
if( $NAME_12 ){print MAIL "$QUANTITY_12 \$$PRICE_12 $ID_12 - $NAME_12 $ADDTLINFO_12 \n";}
if( $NAME_13 ){print MAIL "$QUANTITY_13 \$$PRICE_13 $ID_13 - $NAME_13 $ADDTLINFO_13 \n";}
print MAIL "===================================================================== \n";
print MAIL "SUBTOTAL: $SUBTOTAL \n";
print MAIL "TOTAL: $TOTAL \n";
print MAIL "\n";
print MAIL "FREIGHT: $SHIPPING \n";
print MAIL "\n\n";
print MAIL "Comments: \n";
print MAIL "--------- \n";
print MAIL "$comment \n";
print MAIL " \n";
close MAIL;
}


if( $mode eq "BOTH" || $mode eq "FILE") {

$csvcomments = $comment;
#$csvcomments =~ s/\"/$csvquote/ig;

open (CSVF,">>$csvfilename");
print CSVF "\"";
print CSVF "$months[$month] $day, $year $hour:$min:$sec";
print CSVF "\",\"";
print CSVF "$firstname";
print CSVF "\",\"";
print CSVF "$lastname";
print CSVF "\",\"";
print CSVF "$address";
print CSVF "\",\"";
print CSVF "$city";
print CSVF "\",\"";
print CSVF "$town";
print CSVF "\",\"";
print CSVF "$post-code";
print CSVF "\",\"";
print CSVF "$phone";
print CSVF "\",\"";
print CSVF "$fax";
print CSVF "\",\"";
print CSVF "$email";
print CSVF "\",\"";
print CSVF "$ship-firstname";
print CSVF "\",\"";
print CSVF "$ship-lastname";
print CSVF "\",\"";
print CSVF "$ship-address";
print CSVF "\",\"";
print CSVF "$ship-city";
print CSVF "\",\"";
print CSVF "$ship-town";
print CSVF "\",\"";
print CSVF "$ship-post-code";
print CSVF "\",\"";
print CSVF "$QUANTITY_1";
print CSVF "\",\"";
print CSVF "\$$PRICE_1";
print CSVF "\",\"";
print CSVF "$ID_1";
print CSVF "\",\"";
print CSVF "$NAME_1";
print CSVF "\",\"";
print CSVF "$ADDTLINFO_1";
print CSVF "\",\"";
print CSVF "$QUANTITY_2";
print CSVF "\",\"";
print CSVF "\$$PRICE_2";
print CSVF "\",\"";
print CSVF "$ID_2";
print CSVF "\",\"";
print CSVF "$NAME_2";
print CSVF "\",\"";
print CSVF "$ADDTLINFO_2";
print CSVF "\",\"";
print CSVF "$QUANTITY_3";
print CSVF "\",\"";
print CSVF "\$$PRICE_3";
print CSVF "\",\"";
print CSVF "$ID_3";
print CSVF "\",\"";
print CSVF "$NAME_3";
print CSVF "\",\"";
print CSVF "$ADDTLINFO_3";
print CSVF "\",\"";
print CSVF "$QUANTITY_4";
print CSVF "\",\"";
print CSVF "\$$PRICE_4";
print CSVF "\",\"";
print CSVF "$ID_4";
print CSVF "\",\"";
print CSVF "$NAME_4";
print CSVF "\",\"";
print CSVF "$ADDTLINFO_4";
print CSVF "\",\"";
print CSVF "$QUANTITY_5";
print CSVF "\",\"";
print CSVF "\$$PRICE_5";
print CSVF "\",\"";
print CSVF "$ID_5";
print CSVF "\",\"";
print CSVF "$NAME_5";
print CSVF "\",\"";
print CSVF "$ADDTLINFO_5";
print CSVF "\",\"";
print CSVF "$QUANTITY_6";
print CSVF "\",\"";
print CSVF "\$$PRICE_6";
print CSVF "\",\"";
print CSVF "$ID_6";
print CSVF "\",\"";
print CSVF "$NAME_6";
print CSVF "\",\"";
print CSVF "$ADDTLINFO_6";
print CSVF "\",\"";
print CSVF "$QUANTITY_7";
print CSVF "\",\"";
print CSVF "\$$PRICE_7";
print CSVF "\",\"";
print CSVF "$ID_7";
print CSVF "\",\"";
print CSVF "$NAME_7";
print CSVF "\",\"";
print CSVF "$ADDTLINFO_7";
print CSVF "\",\"";
print CSVF "$QUANTITY_8";
print CSVF "\",\"";
print CSVF "\$$PRICE_8";
print CSVF "\",\"";
print CSVF "$ID_8";
print CSVF "\",\"";
print CSVF "$NAME_8";
print CSVF "\",\"";
print CSVF "$ADDTLINFO_8";
print CSVF "\",\"";
print CSVF "$QUANTITY_9";
print CSVF "\",\"";
print CSVF "\$$PRICE_9";
print CSVF "\",\"";
print CSVF "$ID_9";
print CSVF "\",\"";
print CSVF "$NAME_9";
print CSVF "\",\"";
print CSVF "$ADDTLINFO_9";
print CSVF "\",\"";
print CSVF "$QUANTITY_10";
print CSVF "\",\"";
print CSVF "\$$PRICE_10";
print CSVF "\",\"";
print CSVF "$ID_10";
print CSVF "\",\"";
print CSVF "$NAME_10";
print CSVF "\",\"";
print CSVF "$ADDTLINFO_10";
print CSVF "\",\"";
print CSVF "$QUANTITY_11";
print CSVF "\",\"";
print CSVF "\$$PRICE_11";
print CSVF "\",\"";
print CSVF "$ID_11";
print CSVF "\",\"";
print CSVF "$NAME_11";
print CSVF "\",\"";
print CSVF "$ADDTLINFO_11";
print CSVF "\",\"";
print CSVF "$QUANTITY_12";
print CSVF "\",\"";
print CSVF "\$$PRICE_12";
print CSVF "\",\"";
print CSVF "$ID_12";
print CSVF "\",\"";
print CSVF "$NAME_12";
print CSVF "\",\"";
print CSVF "$ADDTLINFO_12";
print CSVF "\",\"";
print CSVF "$QUANTITY_13";
print CSVF "\",\"";
print CSVF "\$$PRICE_13";
print CSVF "\",\"";
print CSVF "$ID_13";
print CSVF "\",\"";
print CSVF "$NAME_13";
print CSVF "\",\"";
print CSVF "$ADDTLINFO_13";
print CSVF "\",\"";
print CSVF "$SUBTOTAL";
print CSVF "\",\"";
print CSVF "$TOTAL";
print CSVF "\",\"";
print CSVF "$SHIPPING";
print CSVF "\",\"";
print CSVF "$comment";
print CSVF "\"\n";
close CSVF;
}



# Send email conformation to the customer.....
open (MAIL,"|$mailprogram");
print MAIL "To: $email\n";
print MAIL "From: $youremail";
print MAIL "Subject: Order Confirmation\n";
print MAIL "\n\n";
print MAIL "A new order has been received. A summary of this order appears below.\n";
print MAIL "\n";
print MAIL "Order Date: $months[$month] $day, $year $hour:$min:$sec \n";
print MAIL " \n";
print MAIL "Bill To: \n";
print MAIL "-------- \n";
print MAIL " $firstname $lastname \n";
print MAIL " $address \n";
print MAIL " $city, $town, $post-code \n";
print MAIL " $phone \n";
print MAIL " $fax \n";
print MAIL " $email \n";
print MAIL " \n";
print MAIL " \n";
print MAIL "Ship To: \n";
print MAIL "-------- \n";

if ( $ship-address eq "" ) {
print MAIL " Use Billing Address\n";
} else {
print MAIL " $ship-firstname $shiplastname \n";
print MAIL " $ship-address \n";
print MAIL " $ship-city, $ship-town $ship-post-code \n";
print MAIL " $ship-phone \n";;
}

print MAIL " \n";
print MAIL " \n";
print MAIL "Qty Price(\$) Product ID - Product Name\n";
print MAIL "===================================================================== \n";
print MAIL "$QUANTITY_1 \$$PRICE_1 $ID_1 - $NAME_1 $ADDTLINFO_1 \n";
if( $NAME_2 ) {print MAIL "$QUANTITY_2 \$$PRICE_2 $ID_2 - $NAME_2 $ADDTLINFO_2 \n";}
if( $NAME_3 ) {print MAIL "$QUANTITY_3 \$$PRICE_3 $ID_3 - $NAME_3 $ADDTLINFO_3 \n";}
if( $NAME_4 ) {print MAIL "$QUANTITY_4 \$$PRICE_4 $ID_4 - $NAME_4 $ADDTLINFO_4 \n";}
if( $NAME_5 ) {print MAIL "$QUANTITY_5 \$$PRICE_5 $ID_5 - $NAME_5 $ADDTLINFO_5 \n";}
if( $NAME_6 ) {print MAIL "$QUANTITY_6 \$$PRICE_6 $ID_6 - $NAME_6 $ADDTLINFO_6 \n";}
if( $NAME_7 ) {print MAIL "$QUANTITY_7 \$$PRICE_7 $ID_7 - $NAME_7 $ADDTLINFO_7 \n";}
if( $NAME_8 ) {print MAIL "$QUANTITY_8 \$$PRICE_8 $ID_8 - $NAME_8 $ADDTLINFO_8 \n";}
if( $NAME_9 ) {print MAIL "$QUANTITY_9 \$$PRICE_9 $ID_9 - $NAME_9 $ADDTLINFO_9 \n";}
if( $NAME_10 ){print MAIL "$QUANTITY_10 \$$PRICE_10 $ID_10 - $NAME_10 $ADDTLINFO_10 \n";}
if( $NAME_11 ){print MAIL "$QUANTITY_11 \$$PRICE_11 $ID_11 - $NAME_11 $ADDTLINFO_11 \n";}
if( $NAME_12 ){print MAIL "$QUANTITY_12 \$$PRICE_12 $ID_12 - $NAME_12 $ADDTLINFO_12 \n";}
if( $NAME_13 ){print MAIL "$QUANTITY_13 \$$PRICE_13 $ID_13 - $NAME_13 $ADDTLINFO_13 \n";}
print MAIL "===================================================================== \n";
print MAIL "SUBTOTAL: $SUBTOTAL \n";
print MAIL "TOTAL: $TOTAL \n";
print MAIL "\n";
print MAIL "FREIGHT: $SHIPPING \n";
print MAIL "\n\n";
print MAIL "Comments: \n";
print MAIL "--------- \n";
print MAIL "$comment \n";
print MAIL " \n";
close MAIL;


print "Content-type: text/html\n\n";

open (HEAD, $header);
@LINES = <HEAD>;
close HEAD;
print @LINES;

print "<h2>Thank you</h2>";
print "Thank you for your order from our online store. You will receive a confirmation email of your order ";
print "momentarily. Please contact us at $youremail if you have any questions or concerns.";
print "<P>";
print "<A HREF=\"$youremail\" target=_top>Return Home</A>";
print "<P>";

open (FOOT, $footer);
@LINES = <FOOT>;
close FOOT;

print @LINES;

exit;
justin
 
Posts: 53
Joined: Fri Nov 29, 2002 4:35 pm
Location: UK

Postby justin » Fri Dec 13, 2002 4:49 pm

Thanks but I have sorted it out, it was a simple typo mistake.
justin
 
Posts: 53
Joined: Fri Nov 29, 2002 4:35 pm
Location: UK

Postby BadHabit » Thu Jan 16, 2003 12:33 pm

I am have exactly the same problem and I noticed that we are using the same host provider. Can you please share your solutions.

Thanks
BadHabit
WebMaster
 
Posts: 19
Joined: Thu Jan 16, 2003 12:25 pm
Location: Atlanta, Georgia

Postby Djinn » Fri Jan 17, 2003 5:32 pm

Try this code with out the back slash before cgi-bin:
--------------------------------------------------------------------------------------
Old Code

<FORM METHOD="POST" ACTION="/cgi-bin/checkout.pl">

--------------------------------------------------------------------------------------
New Code

<FORM METHOD="POST" ACTION="cgi-bin/checkout.pl">

Good Luck and Cheers Mate ;)
Djinn
 
Posts: 2
Joined: Fri Jan 17, 2003 5:22 pm

Postby BadHabit » Sat Jan 18, 2003 12:36 am

Thanks for the suggestion but that did not help. If I type in the direct URL for the checkout script:

http://<host.com>/cgi-bin/checkout.pl

I get:


Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I figure that if I can't get to it directly the checkout.htm won't find it either. I have the PL script starting as the following:

#!/usr/local/bin/perl
#=====================================================================||
# NOP Design JavaScript Shopping Cart ||
# PERL CGI Checkout Module ||

but have tried also.

#!/usr/bin/perl
#=====================================================================||
# NOP Design JavaScript Shopping Cart ||
# PERL CGI Checkout Module ||


Any help would be great.

Thanks
Last edited by BadHabit on Sat Jan 18, 2003 3:13 pm, edited 1 time in total.
BadHabit
WebMaster
 
Posts: 19
Joined: Thu Jan 16, 2003 12:25 pm
Location: Atlanta, Georgia

Postby Steven Nyland » Sat Jan 18, 2003 10:13 am

You need to check with your hosting company what the PERL path is on the server that hosts your site.

If you then still have errors, in 99% of the cases it is a type somewhere (e-mail string, or form fields).

Hope this helps,

Steven
[ If it ain't Dutch ... it ain't Much ]
Steven Nyland
Guru
 
Posts: 274
Joined: Thu Jan 02, 2003 1:20 pm
Location: Still here ...

Postby BadHabit » Sat Jan 18, 2003 1:29 pm

If appears that the everthing was set up correctly. The problem was the file permissions on the hosting server needed to be set to (rwx-rx-rx). Once I set the permissions the perl script ran correctly with the exception that the orders.cvs file was not updated but that should be minor to fix. Thanks for the suggestion and a great FREE product.
BadHabit
WebMaster
 
Posts: 19
Joined: Thu Jan 16, 2003 12:25 pm
Location: Atlanta, Georgia


Return to Installation and Setup Problems

Who is online

Users browsing this forum: No registered users and 0 guests