<?php error_reporting(E_ALL); ?>
<html>
<head>
<title>DIV-Box</title>
<style type="text/css">
.show { display: block; }
</style>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Box 1? <input type="radio" name="box1" value="ja"<?php if(isset($_POST['box1']) AND ($_POST['box1'] == "ja")) { echo ' checked="checked"'; } ?>> ja
<input type="radio" name="box1" value="nein"<?php if(isset($_POST['box1']) AND ($_POST['box1'] != "ja")) { echo ' checked="checked"'; } ?>> nein<br>
Box 2? <input type="radio" name="box2" value="ja"<?php if(isset($_POST['box2']) AND ($_POST['box2'] == "ja")) { echo ' checked="checked"'; } ?>> ja
<input type="radio" name="box2" value="nein"<?php if(isset($_POST['box2']) AND ($_POST['box2'] != "ja")) { echo ' checked="checked"'; } ?>> nein<br>
Box 3? <input type="radio" name="box3" value="ja"<?php if(isset($_POST['box3']) AND ($_POST['box3'] == "ja")) { echo ' checked="checked"'; } ?>> ja
<input type="radio" name="box3" value="nein"<?php if(isset($_POST['box3']) AND ($_POST['box3'] != "ja")) { echo ' checked="checked"'; } ?>> nein<br>
<input type="submit" value="DIV-Box anzeigen">
</form>
<?php
if(isset($_POST['box1']) AND ($_POST['box1'] == "ja")) {
echo '
<div class="show">
Inhalt der 1. DIV-Box.
</div>
';
}
if(isset($_POST['box2']) AND ($_POST['box2'] == "ja")) {
echo '
<div class="show">
Inhalt der 2. DIV-Box.
</div>
';
}
if(isset($_POST['box3']) AND ($_POST['box3'] == "ja")) {
echo '
<div class="show">
Inhalt der 3. DIV-Box.
</div>
';
}
?>
</body>
</html>