Hi im working with cookies in php and am quite new but i have a button that passes a value through to a function that first echo's it back so i can check if the value is correct and then i upload it set it in the cookie but for some reason the cookie gets a different value.
<input type="button" value="MemberInfo" class="#" id="<?php echo $IGN;?>"onClick="<?php test($IGN);?>"/>
<?php
function test($name)
{
MakeCookie('MemberInfo', $name);
echo $name;
}
function MakeCookie($name, $value)
{
$cookie_name = $name;
$cookie_value = $value;
setcookie($cookie_name, $cookie_value, time()+3600, "/");
}
?>