JackieB
10-01-2006, 07:17 AM
Hi everyone,
Hi, i'm Jackie and i'm new to the HTML scene. I am writing in need of some help as I have to write a basic "shopping cart" for an assignment.
I have done some research and have begun writing simple html code. Essentially i have a form where i enter the quantity i want for ITEM X which cost say $1. When i push submit it goes to a CGI script which i use the quantity to determine how many the customer wants. Now, how do I obtain the price for ITEM X? Is it possible to, on submit, to send the quantity information (user input) and the price (fixed) to the CGI script?
Here's the code part i'm talking about:
----------------------------------------------------------------------
<b>Book 1 Cost:</b> $1
<br>
<form name="input" action="/cgi-bin/add_to_cart.cgi" method="get">
Please enter quantity:
<input type="text" name="Item1Q">
<input type="submit" value="Add to Cart">
</form>
----------------------------------------------------------------------
You see when i go in the cgi script:
my $itemQuantity = param('Item1Q");
$itemQuantity would contain the quantity from html code correct? is it possible to pass, say a nother variable, i.e. the price of the book?
Thanks for any help :) :) ,
Jackie
Hi, i'm Jackie and i'm new to the HTML scene. I am writing in need of some help as I have to write a basic "shopping cart" for an assignment.
I have done some research and have begun writing simple html code. Essentially i have a form where i enter the quantity i want for ITEM X which cost say $1. When i push submit it goes to a CGI script which i use the quantity to determine how many the customer wants. Now, how do I obtain the price for ITEM X? Is it possible to, on submit, to send the quantity information (user input) and the price (fixed) to the CGI script?
Here's the code part i'm talking about:
----------------------------------------------------------------------
<b>Book 1 Cost:</b> $1
<br>
<form name="input" action="/cgi-bin/add_to_cart.cgi" method="get">
Please enter quantity:
<input type="text" name="Item1Q">
<input type="submit" value="Add to Cart">
</form>
----------------------------------------------------------------------
You see when i go in the cgi script:
my $itemQuantity = param('Item1Q");
$itemQuantity would contain the quantity from html code correct? is it possible to pass, say a nother variable, i.e. the price of the book?
Thanks for any help :) :) ,
Jackie