I am trying to pass an array through a hidden field in a form I have on my
confirmation page, all of my other variable pass through fine but I can't get the
array to pass through to the reponse page
----------------------- Step 3 Page -----------------------------------
This is where i have set the array
// Set the array
$_SESSION['grind_array'][] = array(
'Interest' => $_SESSION['Interest'],
'Subject' => $_SESSION['Subject'],
'Level' => $_SESSION['Level'],
'counter' => $_SESSION['counter']
);
-------------- confirmation page ----------------------------------
$tmp = "$timestamp.$merchantid.$orderid.$amount.$curr";
$md5hash = md5($tmp);
$tmp = "$md5hash.$secret";
$md5hash = md5($tmp);
$qualifications = escape_data($_SESSION['qualifications']);
$experience = escape_data($_SESSION['experience']);
$add_location = escape_data($_SESSION['additional_locations']);
$availability = escape_data($_SESSION['availability']);
$rate= escape_data($_SESSION['rate_per_hour']);
$add_number = escape_data($_SESSION['additional_number']);
$email_address = escape_data($_SESSION['email_address']);
$add_info = escape_data($_SESSION['additional_information']);
$grind_array = $_SESSION['grind_array'];
?>
</form>
<form action= method=post>
<input type=hidden name="MERCHANT_ID" value="<?=$merchantid?>">
<input type=hidden name="ORDER_ID" value="<?=$orderid?>">
<input type=hidden name="CURRENCY" value="<?=$curr?>">
<input type=hidden name="AMOUNT" value="<?=$amount?>">
<input type=hidden name="TIMESTAMP" value="<?=$timestamp?>">
<input type=hidden name="MD5HASH" value="<?=$md5hash?>">
<input type=hidden name="AUTO_SETTLE_FLAG" value="1">
<input type=hidden name="USER_ID" value="<?=$_SESSION['user_id']?>">
<input type=hidden name="QUALIFICATIONS" value="<?=$qualifications?>">
<input type=hidden name="EXPERIENCE" value="<?=$experience?>">
<input type=hidden name="ADD_LOCATION" value="<?=$add_location?>">
<input type=hidden name="AVAILABILITY" value="<?=$availability?>">
<input type=hidden name="RATE" value="<?=$rate?>">
<input type=hidden name="ADD_NUMBER" value="<?=$add_number?>">
<input type=hidden name="EMAIL_ADDRESS" value="<?=$email_address?>">
<input type=hidden name="ADD_INFO" value="<?=$add_info?>">
<input type=hidden name="GRINDS" value="<?=$grind_array?>">
------------------ Response Page--------------------------------------
$timestamp = $TIMESTAMP;
$result = $RESULT;
$orderid = $ORDER_ID;
$message = $MESSAGE;
$authcode = $AUTHCODE;
$pasref = $PASREF;
$user_id=$USER_ID;
$qualifications= $QUALIFICATIONS;
$experience = $EXPERIENCE;
$add_location = $ADD_LOCATION;
$availability = $AVAILABILITY;
$rate= $RATE;
$add_number = $ADD_NUMBER;
$email_address = $EMAIL_ADDRESS;
$add_info = $ADD_INFO;
$grind_array = $GRINDS;
if ($result_two)
{
foreach ($grind_array as $entry)
{
$query_three = "INSERT INTO grind_record
(user_id,id_interest,id_subject,id_level,grind_date)
VALUES ('$user_id','{$entry['Interest']}','{$entry['Subject']}','{$entry['Level']}',NOW()
)";
// Run the query
$result_three = @mysql_query ($query_three);
echo'success';
}
}
else
{
echo'failure';
}
confirmation page, all of my other variable pass through fine but I can't get the
array to pass through to the reponse page
----------------------- Step 3 Page -----------------------------------
This is where i have set the array
// Set the array
$_SESSION['grind_array'][] = array(
'Interest' => $_SESSION['Interest'],
'Subject' => $_SESSION['Subject'],
'Level' => $_SESSION['Level'],
'counter' => $_SESSION['counter']
);
-------------- confirmation page ----------------------------------
$tmp = "$timestamp.$merchantid.$orderid.$amount.$curr";
$md5hash = md5($tmp);
$tmp = "$md5hash.$secret";
$md5hash = md5($tmp);
$qualifications = escape_data($_SESSION['qualifications']);
$experience = escape_data($_SESSION['experience']);
$add_location = escape_data($_SESSION['additional_locations']);
$availability = escape_data($_SESSION['availability']);
$rate= escape_data($_SESSION['rate_per_hour']);
$add_number = escape_data($_SESSION['additional_number']);
$email_address = escape_data($_SESSION['email_address']);
$add_info = escape_data($_SESSION['additional_information']);
$grind_array = $_SESSION['grind_array'];
?>
</form>
<form action= method=post>
<input type=hidden name="MERCHANT_ID" value="<?=$merchantid?>">
<input type=hidden name="ORDER_ID" value="<?=$orderid?>">
<input type=hidden name="CURRENCY" value="<?=$curr?>">
<input type=hidden name="AMOUNT" value="<?=$amount?>">
<input type=hidden name="TIMESTAMP" value="<?=$timestamp?>">
<input type=hidden name="MD5HASH" value="<?=$md5hash?>">
<input type=hidden name="AUTO_SETTLE_FLAG" value="1">
<input type=hidden name="USER_ID" value="<?=$_SESSION['user_id']?>">
<input type=hidden name="QUALIFICATIONS" value="<?=$qualifications?>">
<input type=hidden name="EXPERIENCE" value="<?=$experience?>">
<input type=hidden name="ADD_LOCATION" value="<?=$add_location?>">
<input type=hidden name="AVAILABILITY" value="<?=$availability?>">
<input type=hidden name="RATE" value="<?=$rate?>">
<input type=hidden name="ADD_NUMBER" value="<?=$add_number?>">
<input type=hidden name="EMAIL_ADDRESS" value="<?=$email_address?>">
<input type=hidden name="ADD_INFO" value="<?=$add_info?>">
<input type=hidden name="GRINDS" value="<?=$grind_array?>">
------------------ Response Page--------------------------------------
$timestamp = $TIMESTAMP;
$result = $RESULT;
$orderid = $ORDER_ID;
$message = $MESSAGE;
$authcode = $AUTHCODE;
$pasref = $PASREF;
$user_id=$USER_ID;
$qualifications= $QUALIFICATIONS;
$experience = $EXPERIENCE;
$add_location = $ADD_LOCATION;
$availability = $AVAILABILITY;
$rate= $RATE;
$add_number = $ADD_NUMBER;
$email_address = $EMAIL_ADDRESS;
$add_info = $ADD_INFO;
$grind_array = $GRINDS;
if ($result_two)
{
foreach ($grind_array as $entry)
{
$query_three = "INSERT INTO grind_record
(user_id,id_interest,id_subject,id_level,grind_date)
VALUES ('$user_id','{$entry['Interest']}','{$entry['Subject']}','{$entry['Level']}',NOW()
)";
// Run the query
$result_three = @mysql_query ($query_three);
echo'success';
}
}
else
{
echo'failure';
}