Using Drupal 5.2
Attempting to create what will be a multistep order form. Trying to incorporate our affiliate tracking system (another drupal module) with it. Basically, when someone comes in via an affilate link, we set two cookies, using standard php cookie setting functions. That part works fine. When someone visits our order form, we want to grab those two cookies and embed them into the form (hidden fields):
The reason I'm giving you all this detail about the cookies is, when I include the code to grab the cookies, the multistep form stops working!
---Example Code (Lifted directly from our order module source, where we're playing with this currently) ---
function abc_module_order_form($form_values = NULL)
{
global $user;
if (!isset($form_values)) {
$step = 1;
}
else {
$step = $form_values['step'] + 1;
}
$form['step'] = array(
'#type' => 'textfield',
'#value' => $step,
);
switch ($step) {
case 1:
if($_COOKIE["cookie1"]){
$c1= $_COOKIE["cookie1"];
if ($_COOKIE["cookie2"]){
$c2=$_COOKIE["cookie2"];
}
}
$form['c1'] = array(
'#type' => 'hidden',
'#default_value' => $c1,
);