bunny1
03-25-2007, 01:17 PM
I have a form with a text field on it
In the action of the form i need to use the value of the field in the header.
How do i get this value from the form
Here is the code where i am trying to get the value of the "qty" textfield into the form action
<form action="cart.php?qty=<?php echo $_POST['qty']; >" method="post" name="form1" class="style15">
<p><strong>Quantity</strong>:<input name="qty" type="text" id="qty" value="1" size="2" maxlength="4"></p>
<p><input name="Submit" type="submit" value="Add to Cart"></p>
</form>i have used $_POST but i dont know if this will take data from the previous page.
i must have the qty in the form action i cannot use the $_POST method to get the field value on the next page as ive already tried this but it doesnt work with the rest of my code
Thanks
In the action of the form i need to use the value of the field in the header.
How do i get this value from the form
Here is the code where i am trying to get the value of the "qty" textfield into the form action
<form action="cart.php?qty=<?php echo $_POST['qty']; >" method="post" name="form1" class="style15">
<p><strong>Quantity</strong>:<input name="qty" type="text" id="qty" value="1" size="2" maxlength="4"></p>
<p><input name="Submit" type="submit" value="Add to Cart"></p>
</form>i have used $_POST but i dont know if this will take data from the previous page.
i must have the qty in the form action i cannot use the $_POST method to get the field value on the next page as ive already tried this but it doesnt work with the rest of my code
Thanks