如何从PHP获取特定的无线电值

I'm not getting the right value from my radio buttons on my 'Thank You' page.

I want that after my user end the payment and he get redirected to the thank you page some values from the filled form to be posted there. And I have archive just that with this script on the form.php file:

<script type="text/javascript">

function CookieTheFormValues() {
var cookievalue = new Array();
var fid = document.getElementById(FormID);
for (i = 0; i < fid.length; i++)
{
   var n = escape(fid[i].name);
   if( ! n.length ) { continue; }
   var v = escape(fid[i].value);
   cookievalue.push( n + '=' + v );
}
var exp = "";
if(CookieDays > 0)
{
   var now = new Date();
   now.setTime( now.getTime() + parseInt(CookieDays * 24 * 60 * 60 * 1000) );
   exp = '; expires=' + now.toGMTString();
}
document.cookie = CookieName + '=' + cookievalue.join("&") + '; path=/' + exp;
return true;
}
</script>

And than by putting this script on the thank you page :

<?php
$CookieName = "PersonalizationCookie";
$Personal = array();
foreach( explode("&",@$_COOKIE[$CookieName]) as $chunk )
{
   list($name,$value) = explode("=",$chunk,2);
   $Personal[$name] = htmlspecialchars($value);
}
?>

So far so good I get all right values from other inputs but from radios I get always the last in class name value? This mean for eg if I have this code:

 <input type="radio" name="emotion" id="basi" value="Basic Pack"    />

  <input type="radio" name="emotion" id="deli"  value="Deluxe Pack" />

 <input type="radio" name="emotion" id="premi"  value="Premium Pack"/>

And in the Thank you page I put this code for eg

Thank you for chosing <?php echo(@$Personal["emotion"]); ?> 

I get always this Thank you for choosing Premium Pack even when i check the basic or deluxe radio why this?

Your loop:

for (i = 0; i < fid.length; i++)
{
   var n = escape(fid[i].name);
   if( ! n.length ) { continue; }
   var v = escape(fid[i].value);
   cookievalue.push( n + '=' + v );
}

will push all three of the radios into your cookie value. Each one will overwrite the previous, because they have the same name. So ultimately you're left with the value 'Premium Pack' mapped to the "emotion" name. You need to check if the radio is selected before you push the val, maybe something like:

for (i = 0; i < fid.length; i++)
{
   var n = escape(fid[i].name);
   if( ! n.length ) { continue; }
   var v = escape(fid[i].value);
   // Only push in the selected emotion radio button
   if (n == "emotion") {
       if (fid[i].checked == true) cookievalue.push( n + '=' + v );
   }
   else cookievalue.push( n + '=' + v );
}