Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Passing Variables


olsonsp4c

Recommended Posts

could someone give me some input on how I might be able to do something?

 

This is an example only just to pose the situation...

 

Your customer is on the checkout_shipping.php page and clicks on a check box that passes the value 1 into the variable 'accept' in order to accept liability for shipping damage.

 

The customer then goes to checkout_payment.php to choose a payment method.

 

The customer then goes to checkout_confirmation.php

 

The issue is how to get to checkout_confirmation.php without LOSING the 'accept' variable value - how do you pass the variable on from page to page to page?

 

Thanks!

 

Scott

Link to comment
Share on other sites

so, would it be like this?

 

checkout_shipping.php

 

<td class="main" align="right" valign="middle"><input type="checkbox" name="accept_liability" value="1">Select this box to accept liability up to $500...</td>

 

value is stored in 'accept_liability'

 

checkout_payment.php

 

session_start();
$_SESSION['accept_liability'] = $accept_liability;

 

value is stored in $accept_liability

 

checkout_confirmation.php

 

$accept_liability = $_POST[$accept_liability];

 

thanks!

 

Scott

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...