<html>
<head>
<?
// Anfangszustand
$a="checked";
$b="";

if (isset($_GET['knopf']))
{
   $wert=$_GET['nahrung'];
   if ($wert == "brot")
   {
      echo "Sie haben Brot gewählt.<br>";
      $a="checked";
      $b="";
   }
   else if ($wert == "milch")
   {
      echo "Sie haben Milch gewählt.<br>";
      $a="";
      $b="checked";
   }
}
?>
</head>
<body>
<h2>Optionsfeld:</h2>
<form action="./gui2.php" method="get">
<input type="radio" name="nahrung" value="brot" <?=$a?> >
Brot oder
<input type="radio" name="nahrung" value="milch" <?=$b?> >
Milch
<input type="submit" name="knopf" value="Aktion">
</form>
</body>
</html>