Zen Cart Logo
Forums / General Questions / $_POST vatiables

$_POST vatiables

Locked

Views: 1,050

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
18 Dec 2008, 10:45 PM
#1
alsmith avatar

alsmith

New Zenner

Join Date:
May 2004
Posts:
10
Plugin Contributions:
0

$_POST vatiables

I am trying to add an additional field to my checkout_shipping, Not a problem it is added to the tpl_checkout_shipping_default.php and it appears on my form.
Now when I submit the page to go to ?main_page=checkout_payment I tried to read the $_POST['fieldname'] and nothing there.

I put this in the top of the template page and nothing for either the POST or GET.

print(’<pre>’);
print_r($_POST);
print(’</pre>’);

Can someone tell me how to pass from one page to another then to finally store into the DB?

18 Dec 2008, 11:37 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: $_POST vatiables

This is most likely because checkout_shipping doesn't go directly to checkout_payment.

Instead it calls itself, checks that it has everything it needs and if not redisplays the checkout_shipping form.

Only if it's good to go forward will it redirect to checkout_payment page, wiping $_POST along the way.

So to preserve your new data, you would need to detect it in the header_php file for checkout_shipping and store it in a $_SESSION variable.