Forum Moderators: coopster

Message Too Old, No Replies

Passing a Variable

         

ScriptJnr

8:44 pm on Mar 28, 2008 (gmt 0)

10+ Year Member



Help.

<form method = "GET" action = "basket.php">
<input type = "text" name = "quantity" size = "1">
<a href = "basket.php?action=additem&barCode=<?php echo $row['barCode']; ?>&quantityOrdered=*******>Add</a>
</form>

I want to pass whatever a user inputs in the above form into the "quantityOrdered" variable above where I asterisked.

I have no clue how to. Any help would be appreciated.

[edited by: ScriptJnr at 8:44 pm (utc) on Mar. 28, 2008]

mooger35

8:51 pm on Mar 28, 2008 (gmt 0)

10+ Year Member



<form method="GET" action="basket.php">
<input type="text" name="quantity" size="1" value="0">
<input type="hidden" name="barcode" value="<?php echo $row['barCode'];?>">
<input type="submit" value="Add" name="add">
</form>

then on the basket.php page you would use $_POST['quantity'] to get the quantity and $_POST['barcode'] to get the barcode.

ScriptJnr

8:55 pm on Mar 28, 2008 (gmt 0)

10+ Year Member



I'll give it a go and let you know how it goes.

Thank you.