#!/usr/bin/perl # "Dansie Shopping Cart" $version = "3.21"; # A Perl Shopping Cart # By Dansie Website Design # Copyright © Dec 10, 1997-2001 # www.dansie.net # cart@dansie.net # May not be used without purchasing a license. Do not attempt to run this # script on a site other than which it was licensed for. # Modification of this script other than: # 1. Adjusting the perl path in the first line above. # 2. Or setting the $vars variable below. # May void your right to technical support and subject you to legal action. # In some cases the first line above may need to be set to: #!/usr/local/bin/perl # Or: #!/usr/bin/perl5 # Set this $vars variable to the system path location of your vars.dat file if this # script can't auto detect it's location or if you wish to rename or relocate # the vars.dat file. See section 7 in the ReadMe for details. # http://www.dansie.net/cart_readme.html $vars = ""; ##################################################################### ### END OF ALL VARIABLES. DO NOT ATTEMPT TO RUN THIS SCRIPT ON A ### ### SITE OTHER THAN WHICH IT WAS LICENSED FOR. DO NOT MODIFY THE ### ### SCRIPT EXCEPT FOR THE $vars VARIABLE OR PERL PATH ABOVE. ### ### MODIFYING THE SCRIPT MAY TERMINATE YOUR RIGHT TO TECHNICAL ### ### SUPPORT AND SUBJECT YOU TO LEGAL ACTION. ### ##################################################################### if ( (!$vars) && ($ENV{'REMOTE_ADDR'} eq "127.0.0.1") ) { $vars = "C:/Dansie/Dansie_Cart/cgi-bin/vars.dat"; } $flock = 1; if (!$ENV{'DOCUMENT_ROOT'}) { $flock = 0; } $delimiter = "|"; $delimiter2 = "\\" . "$delimiter"; $merchant_security = 1; $diagnostics = 0; $vars_variable_set = "$vars"; if (!$vars && $ENV{'OS'} !~ /Windows_NT/i && $ENV{'DOCUMENT_ROOT'} ) { $vars = `pwd`; chop($vars); $script_root = "$vars"; $vars .= "/vars.dat"; $script_root2 = "$ENV{'SCRIPT_NAME'}"; $script_root2 = reverse($script_root2); until ($script_root2 !~ /\//) { chop($script_root2); } $script_root2 = reverse($script_root2); $script_root2 = "$script_root/$script_root2"; if (!-e"$vars") { $script_root = $ENV{'SCRIPT_NAME'}; $script_root2 = "$ENV{'DOCUMENT_ROOT'}$ENV{'SCRIPT_NAME'}"; $a = ""; until ($a eq "/" || $script_root eq "") { $a = chop($script_root); } $script_root = "$ENV{'DOCUMENT_ROOT'}$script_root"; $vars = "$script_root/vars.dat"; } if (!-e"$vars") { $script_root = $ENV{'SCRIPT_FILENAME'}; $script_root2 = $ENV{'SCRIPT_FILENAME'}; $a = ""; until ($a eq "/" || $script_root eq "") { $a = chop($script_root); } $vars = "$script_root/vars.dat"; } } if (!$vars && $ENV{'OS'} =~ /Windows_NT/i ) { if ($ENV{'PATH_TRANSLATED'}) { $script_root = $ENV{'PATH_TRANSLATED'}; $script_root2 = $ENV{'PATH_TRANSLATED'}; } if ($ENV{'DOCUMENT_ROOT'}) { $temp = "$ENV{'DOCUMENT_ROOT'}"; while ($temp =~ /[\\|\/]$/) { chop($temp); } if (!-e "$temp$ENV{'SCRIPT_NAME'}") { $a = ""; until ($a eq "/" || $a eq "\\" || $temp eq "") { $a = chop($temp); } } $script_root = "$temp$ENV{'SCRIPT_NAME'}"; $script_root2 = "$temp$ENV{'SCRIPT_NAME'}"; } $script_root =~ s/\\/\//g; $script_root2 =~ s/\\/\//g; $a = ""; until ($a eq "/" || $script_root eq "") { $a = chop($script_root); } $vars = "$script_root/vars.dat"; } if ( ((!-e "$vars") || (!$vars)) && (!$ENV{'OS'}) ) { if ($ENV{'DOCUMENT_ROOT'}) { $vars = `pwd`; } chop($vars); $script_root = "$vars"; $vars .= "/vars.dat"; $script_root2 = "$ENV{'SCRIPT_NAME'}"; $script_root2 = reverse($script_root2); until ($script_root2 !~ /\//) { chop($script_root2); } $script_root2 = reverse($script_root2); $script_root2 = "$script_root/$script_root2"; } if ((!-e "$vars") && !$ENV{'DOCUMENT_ROOT'} && !$ENV{'OS'} ) { $script_root = "$ENV{'PATH'}"; while ( $script_root =~ /;/ ) { chop($script_root); } $script_root .= "$ENV{'SCRIPT_NAME'}"; $script_root2 = "$script_root"; $script_root =~ s/\\/\//g; $script_root2 =~ s/\\/\//g; $a = ""; until ($a eq "/" || $script_root eq "") { $a = chop($script_root); } $vars = "$script_root/vars.dat"; } if ( ( (!-e "$vars") || (!$vars) ) && (!$ENV{'OS'}) ) { $vars = `pwd`; chop($vars); $script_root = "$vars"; $vars .= "/vars.dat"; $script_root2 = "$ENV{'SCRIPT_NAME'}"; $script_root2 = reverse($script_root2); until ($script_root2 !~ /\//) { chop($script_root2); } $script_root2 = reverse($script_root2); $script_root2 = "$script_root/$script_root2"; } if ( ((!-e "$script_root2") && (!-e "$vars")) || (( $script_root2 !~ /cart/i ) && (!-e "$vars")) ) { if (!$script_root2) { $script_root2 = "$vars"; $a = ""; until ($a eq "/" || $script_root2 eq "") { $a = chop($script_root2); } } &diagnostics; print "Content-type: text/html\n\n"; print "
| This Demo Cart will allow you to POST any item and price to it so you may run tests with HTML forms that you create. However, the cart has a security feature where you can prevent people from posting to your cart from other than the domains you specifically authorize. See Personal Variable #66 in the ReadMe for details. |
| "; print "$lang[10] \"$payable\" "; print "$lang[11] "; print "$add1 "; print "$add2 "; print "$add3 "; print "$add4 " if ( $add4 ); print "\n\n $guarantee \n\n"; print " $lang[12] $bizname "; print "$add5 "; print"$myemail[0] "; print " |
| \n\n\n\n\n\n |