Ok,
I have two radio buttons 'A' and 'B' and user have a choice to select anyone of them,
by default button 'A' is selected but when user come to my website and selects 'B' then selection changes to button 'B' however the problem is,
when the user move to another page in my site the selection goes back to default :S ??
How to fix it ??
can it be done with the help of cache and session ? if yes then how :?
here is the buttons,
<form name="f1" method="POST" action="<?php echo $PHP_SELF;?>">
<span>Family filter:</span>
<ul>
<li><input type="radio" name="r1" value="o" onClick="submit();" <?php echo ($_POST['r1'] == 'o') ? 'checked="checked"' : ''; ?> />On</li>
<li><input type="radio" name="r1" value="p" onClick="submit();" <?php echo ($_POST['r1'] == 'p') ? 'checked="checked"' : ''; ?> />Off</li>
</ul>
</form>
I tried this but doesn't work,
<form name="f1" method="POST" action="<?php echo $PHP_SELF;?>">
<span>Family filter:</span>
<ul>
<li><input type="radio" name="r1" value="o" onClick="submit();" <?php echo ($_SESSION['r1'] == "o") ? 'checked="checked"' : ''; ?><?php echo ($_POST['r1'] == 'o' ) ? 'checked="checked"' : ''; ?> />On</li>
<li><input type="radio" name="r1" value="p" onClick="submit();" <?php echo ($_SESSION['r1'] == "p") ? 'checked="checked"' :''; ?><?php echo ($_POST['r1'] == 'p') ? 'checked="checked"' : ''; ?> />Off</li>
</ul>
</form>
and the Top,
<?php
session_start();
$r1= $_POST["r1"];
session_register("r1");
?>