I'm just getting started in php and using forms to pass the variables via post and/or session. Here is what I want to do. I want 900 to pass onto the next page when I submit. $subtotal = 900; <input type="hiddend" name="total" value=$subtotal /> <input type="submit" name="Submit" value="Pay" /> Code (markup): However, the above code just passes a 0. Is there a way to pass $subtotal ? Thanks.
I guess I should elaborate a little bit more. I need to pass the $900 to the merhant's site. The example they gave me was ...action=[URL]https://merchantsite.com/process.asp[/URL] /> <input type="text" name="total" value="900"> Code (markup): However, I have a script that calculates the subtotal for the customer, so all they have is click the "pay" button. Thanks for the quick repsonse though. -Rob
that's cool,and that's the easiest way of course,you can type <input type="hiddend" name="total" value="<?=$subtotal;?>" /> for short,but it is not recommened now.
This should work 100%, <input type="hidden" name="total" value="<?php echo $subtotal;?>" /> Code (markup):