Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Passing form variable values to next page


chrisptx

Recommended Posts

I'm currently adding a new feature which uses an advertisement promo code that a customer can enter when placing an order. If they enter a ad promo code, then they will receive a discount, plus the person who referred the customer to the site will receive a percentage of the order.

 

So, on the checkout_shipping.php page, I added a box for the customer to enter an adcode, using the following code:

 

<tr>

<td class="main">

<input type="text" name="adcode" size=6 maxlength=6>

</td>

</tr>

 

This works fine for the input part, but when I get to the next page, which is checkout_payment.php, I can't seem to access the value of what was typed into the above textbox named "adcode."

 

I've tried accessing it via all of the following variables:

 

$_POST['adcode']

$_GET['adcode']

$GLOBALS['adcode']

$HTTP_GET_VARS['adcode']

$HTTP_POST_VARS['adcode']

 

and finally $adcode itself, which I declared as global on the checkout_shipping.php page with the following code:

 

if (!tep_session_is_registered('adcode')) {

global $adcode;

tep_session_register('adcode');

}

 

I can't figure out how to access the value entered in the form from the previous page, and have about given up.

 

I also can't figure out why the "Continue" image on the checkout_shipping.php page functions as it does. It doesn't seem

to be an <a href=> link, nor an "onclick=submit" type image. Can someone clue me in as to how the Continue image actually

functions and how it's set up, and which URL it points to?

 

I expected it to be submitting a form with the "post" option, but I don't think that's what's going on here...

 

Please help! :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...