Could someone help me to check my code, no matter what value i clicked,the radio always checked on the last one. it doesn't postback correctly, however the return "echo" value is right.
Thanks a lot
here is my code
<html>
<form id="form" name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input type="radio" name="foo" value="Apple" checked="checked" <?php if(isset($_POST['foo']) == 'Apple'): echo "checked='checked'"; endif; ?>/>Apple
<input type="radio" name="foo" value="Banana" <?php if(isset($_POST['foo']) == 'Banana'): echo "checked='checked'"; endif; ?>/>Banana
<input type="radio" name="foo" value="Orange" <?php if(isset($_POST['foo']) == 'Orange'): echo "checked='checked'"; endif; ?>/>Orange
<input type="submit" value="Confirm" /> </form>
<? if(isset($_POST['foo']))
{echo $_POST['foo'];
}
?>
</html>