Skorpion
<?php error_reporting(E_ALL);
// zodiac sign in German
$signs = array(1 => 'Steinbock',
'Wassermann',
'Fische',
'Widder',
'Stier',
'Zwilling',
'Krebs',
'Löwe',
'Jungfrau',
'Waage',
'Skorpion',
'Schütze'
);
// ---------------------------------
function ZodiacSign($day,$month) {
// ----------?-------------
$days = array(1 => 20, 19, 20, 20, 20, 21, 22, 23, 23, 23, 22, 21);
// ----------?-------------
if ($day <= $days[$month]){
return $month;
} else if ($month == 12){
return 1;
} else {
return $month + 1;
}
} // END function ZodiacSign
// ----------------------------------
$day = (isset($_GET['day']) ? $_GET['day'] : date('j') );
$month = (isset($_GET['month']) ? $_GET['month'] : date('n') );
echo <<<html
<form action="StarSign.php" method="GET">
<fieldset style="white-space:pre;">
Monat (1-12): <input type="text" name="month" maxlength="2" size="2" value="{$month}" /> Tag (1-31): <input type="text" name="day" maxlength="2" size="2" value="{$day}" />
<input type="submit">
</fieldset>
</form>
html;
echo $signs[ZodiacSign( $day , $month )];
?>
<br>
<hr>
<?php highlight_file(__FILE__) ?>