//open and display file contents
$myFile = fopen($starFile, "r");
$myStarsign = " ";
if(!($myFile))
{
print("
Error. File could not be found.");
exit;
}
else {
while(!feof($myFile)){
//read a line from the file
$myLine = fgets($myFile, 80);
$myStarsign = ($myStarsign . $myLine);
}
fclose($myFile); //close file
$myLine = "";
$myPos0 = (strpos($myStarsign, "ARIES:"));
$myPos1 = (strpos($myStarsign, "TAURUS:"));
$myPos2 = (strpos($myStarsign, "GEMINI:"));
$myPos3 = (strpos($myStarsign, "CANCER:"));
$myPos4 = (strpos($myStarsign, "LEO:"));
$myPos5 = (strpos($myStarsign, "VIRGO:"));
$myPos6 = (strpos($myStarsign, "LIBRA:"));
$myPos7 = (strpos($myStarsign, "SCORPIO:"));
$myPos8 = (strpos($myStarsign, "SAGITTARIUS:"));
$myPos9 = (strpos($myStarsign, "CAPRICORN:"));
$myPos10 = (strpos($myStarsign, "AQUARIUS:"));
$myPos11 = (strpos($myStarsign, "PISCES:"));
$intLen = strLen($myStarsign);
switch($_REQUEST["ID"])
{
case "aries":
$txtStarsign = substr($myStarsign, $myPos0, ($myPos1 - $myPos0));
$txtStarsign = ereg_replace("ARIES:", "", $txtStarsign);
break;
case "taurus":
$txtStarsign = substr($myStarsign, $myPos1, ($myPos2 - $myPos1));
$txtStarsign = ereg_replace("TAURUS:", "", $txtStarsign);
break;
case "gemini":
$txtStarsign = substr($myStarsign, $myPos2, ($myPos3 - $myPos2));
$txtStarsign = ereg_replace("GEMINI:", "", $txtStarsign);
break;
case "cancer":
$txtStarsign = substr($myStarsign, $myPos3, ($myPos4 - $myPos3));
$txtStarsign = ereg_replace("CANCER:", "", $txtStarsign);
break;
case "leo":
$txtStarsign = substr($myStarsign, $myPos4, ($myPos5 - $myPos4));
$txtStarsign = ereg_replace("LEO:", "", $txtStarsign);
break;
case "virgo":
$txtStarsign = substr($myStarsign, $myPos5, ($myPos6 - $myPos5));
$txtStarsign = ereg_replace("VIRGO:", "", $txtStarsign);
break;
case "libra":
$txtStarsign = substr($myStarsign, $myPos6, ($myPos7 - $myPos6));
$txtStarsign = ereg_replace("LIBRA:", "", $txtStarsign);
break;
case "scorpio":
$txtStarsign = substr($myStarsign, $myPos7, ($myPos8 - $myPos7));
$txtStarsign = ereg_replace("SCORPIO:", "", $txtStarsign);
break;
case "sagittarius":
$txtStarsign = substr($myStarsign, $myPos8, ($myPos9 - $myPos8));
$txtStarsign = ereg_replace("SAGITTARIUS:", "", $txtStarsign);
break;
case "capricorn":
$txtStarsign = substr($myStarsign, $myPos9, ($myPos10 - $myPos9));
$txtStarsign = ereg_replace("CAPRICORN:", "", $txtStarsign);
break;
case "aquarius":
$txtStarsign = substr($myStarsign, $myPos10, ($myPos11 - $myPos10));
$txtStarsign = ereg_replace("AQUARIUS:", "", $txtStarsign);
break;
case "pisces":
$txtStarsign = substr($myStarsign, $myPos11, ($intLen - $myPos11));
$txtStarsign = ereg_replace("PISCES:", "", $txtStarsign);
break;
default:
// $txtStarsign = ("Please choose a starsign from the
menu.");
break; //redirect
}
print($txtStarsign);
}
?>
© Copyright, Alison Moroney,
if ($boolPY == 1) {
print(date("Y", $prevYear));
}
elseif ($boolPY == 0) {
print(date("Y", $today));
}
?>
return to menu.