Sorted Prob with 'form' and 'buy2'

greenspun.com : LUSENET : S-Mart Shopping Cart : One Thread

Hi Guys I have just started playing around with e S-Mart shopping cart system, I was running though the FAQ and found comments on the problem with the form, I have been hitting my head against the wall over this, then after reading these comments it came to me.

Yes there is a problem with the script what's happening is when the review page is generated it is may up of a 'form' the default of this form is

what going wrong is when the form to collect the users info is pulled in even if you set this bit to the right place is still see the first form tag thus setting it to ?command=change instead of ?command=buy2 this all be came very clear after reading your comments, but Mark you seem to have gone round a VERY long way to sort the problem the default codes reads

# List items in cart. sub list_items { my($totalprice,$totalquant,$totalweight) = 0; open (REFFILE,"$reffile") || die "Content-type: text/html\n\nCan't Open $reffile(r): $!\n"; my(@LINES)=; close(REFFILE); $SIZE=@LINES; print "\n"; print "

"; print "\n"; so on and so on....... Change it to....... # List items in cart. sub list_items { my($totalprice,$totalquant,$totalweight) = 0; open (REFFILE,"$reffile") || die "Content-type: text/html\n\nCan't Open $reffile(r): $!\n"; my(@LINES)=; close(REFFILE); $SIZE=@LINES; ################################# these lines can be removed, just showing what's changed ############# if ($command eq 'buy1'){ print "\n"; } else { print "\n"; } ################################# these lines can be removed, just showing what's changed ############# print "
"; print "
\n"; and all well.

Brain

-- Brain Canning (brian@netresults-media.co.uk), December 22, 1999

Answers

:)

-- Patrick Chan (patrickccf@hotmail.com), April 06, 2000.

Moderation questions? read the FAQ