passing variables
Moderator: General Moderators
-
username10
- Forum Newbie
- Posts: 5
- Joined: Tue Nov 11, 2003 11:40 am
passing variables
Please help.
I have a quote form (javascript and php). When the user submit the information, they are returned a calculated quote.
If the user agrees, they would then click a purchase button.
I need to carry that quote on to "2checkout" (a shopping cart), and am lost on the approach.
Please help.
Al
I have a quote form (javascript and php). When the user submit the information, they are returned a calculated quote.
If the user agrees, they would then click a purchase button.
I need to carry that quote on to "2checkout" (a shopping cart), and am lost on the approach.
Please help.
Al
-
username10
- Forum Newbie
- Posts: 5
- Joined: Tue Nov 11, 2003 11:40 am
- Johnm
- Forum Contributor
- Posts: 344
- Joined: Mon May 13, 2002 12:05 pm
- Location: Michigan, USA
- Contact:
Are you using sessions? If so, set it as a session var and you will have it any page through out the session. If not, set a var equal to the POST (or get depending on which you use) var.
John M
P.S. You like the steel-your-face huh, LOL. Most people on this forum have no idea what it means. But that is okay I guess... more music for me!
John M
P.S. You like the steel-your-face huh, LOL. Most people on this forum have no idea what it means. But that is okay I guess... more music for me!
-
username10
- Forum Newbie
- Posts: 5
- Joined: Tue Nov 11, 2003 11:40 am
I'll read up on setting a variable to post.
......GD logo
http://charmcreations.com/Products/inde ... l/2965.htm
......GD logo
http://charmcreations.com/Products/inde ... l/2965.htm
- Johnm
- Forum Contributor
- Posts: 344
- Joined: Mon May 13, 2002 12:05 pm
- Location: Michigan, USA
- Contact:
If you are using the POST method then it is already there on the second page so on the second page set the var to the POST value. Sessions would be worth looking into.
John M
Code: Select all
<?php
$var = $_POST['varName']
?>John M
Last edited by Johnm on Tue Nov 11, 2003 2:04 pm, edited 2 times in total.
You meanJohnm wrote:If you are using the POST method then it is already there on the second page so on the second page set the var to the POST value. Sessions would be worth looking into.
Code: Select all
<?php var = $_POST['varName'] ?>
John M
Code: Select all
<?php
$var = $_POST['varName']
?>?>
- mrvanjohnson
- Forum Contributor
- Posts: 137
- Joined: Wed May 28, 2003 11:38 am
- Location: San Diego, CA
There is a PHP Shopping cart tutorial that might help you
http://www.macromedia.com/devnet/mx/dre ... _cart.html
http://www.macromedia.com/devnet/mx/dre ... _cart.html
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
haha its still not rightJohnm wrote:If you are using the POST method then it is already there on the second page so on the second page set the var to the POST value. Sessions would be worth looking into.
Code: Select all
<?php $var = _POST['varName'] ?>
John M
Code: Select all
<?php
$var = $_POST['varName']
?>-
username10
- Forum Newbie
- Posts: 5
- Joined: Tue Nov 11, 2003 11:40 am
It's hard being new, but this is what I did. Yes , it's not right. need more help. I'm trying to get the totalcharge value into the total value of the new form.
<form method="post" action="..." name="form">
<?php
$total = $_POST['totalcharge']
?>
<p>Total Purchase
<input type="text" name="total" value=$total>
</p>
<p>
<input type="hidden" name="sid" value="123">
<input type="hidden" name="cart_order_id" value="quote">
<input type="hidden" name="demo" value="y">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
Thanks
JR
<form method="post" action="..." name="form">
<?php
$total = $_POST['totalcharge']
?>
<p>Total Purchase
<input type="text" name="total" value=$total>
</p>
<p>
<input type="hidden" name="sid" value="123">
<input type="hidden" name="cart_order_id" value="quote">
<input type="hidden" name="demo" value="y">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
Thanks
JR
- mrvanjohnson
- Forum Contributor
- Posts: 137
- Joined: Wed May 28, 2003 11:38 am
- Location: San Diego, CA
-
username10
- Forum Newbie
- Posts: 5
- Joined: Tue Nov 11, 2003 11:40 am