need some php help...?

Bat

New member
my code below works fine however i need to save this info as a cookie and then echo the cookie not the variable like im doing below.
i've tryed setting it as a cookie but it mess's up the script and it doesn't do what the script is ment to.
if anyone could have a look at this script and get it to save in a cookie and then be retrived that would be great

cheers

Code:
<?php

$sport_list='';

if (isset($_POST['sports'])) {
$sport = $_POST['sports'];
$dts = date("G:i:s d/m/y");
if ($_POST['sport_list']) {
$sport_list = "<li style='text-decoration: underline;'>$sport $dts" . $_POST['sport_list'] . "</li>";
} else {
$sport_list = "<li>$sport $dts</li>";
}
}

?>

<form name="sports" action="<?php echo($_SERVER['PHP_SELF']); ?>" method="post" >
<input type="hidden" name="sport_list" value="<?php echo($sport_list); ?>">
<input type="radio" name="sports" id="e_2" value="FMX" onclick="document.sports.submit();" /><label for="e_2">FMX</label></p>
<input type="radio" name="sports" id="e_1" value="bmx" onclick="document.sports.submit();" /><label for="e_1">BMX</label></p>
</form>

<?php echo($sport_list); ?>
 
Back
Top