Hello,I wrote some code for getting sign by birthday.
You need to create two file.
One is the file with the the code below and name it as sign_form.php
<form action=”get_sign.php” value=”">
year:<input name=”year” valut=”" type=”text” /> <br />
month:<input name=”month” valut=”" type=”text” /> <br />
day:<input name=”day” valut=”" type=”text” /> <br />
submit:<input submit=”submit” valut=”submit” type=”submit” /> <br />
</form>
then have another file with the code as below and save it as get_sign.php
if((date(m) > $_POST[’month’]) || (date(m) == $_POST[’month’] && $_POST[’day’] <= date(d))){
$age = date(Y) - $_POST[’year’] + 1;
}else{
$age = date(Y) - $_POST[’year’];
}
if(($_POST[’month’] == 1 && $_POST[’day’] >= 21) OR ($_POST[’month’] == 2 && 19 >= $_POST[’day’])){
$sign = “Aquarius”;
} elseif(($_POST[’month’] == 2 && 20 <= $_POST[’day’]) OR ($_POST[’month’] == 3 && $_POST[’day’] <= 20)){
$sign = “Pisces”;
} elseif(($_POST[’month’] == 3 && 21 <= $_POST[’day’]) OR ($_POST[’month’] == 4 && $_POST[’day’] <= 20)){
$sign = “Aries”;
} elseif(($_POST[’month’] == 4 && 21 <= $_POST[’day’]) OR ($_POST[’month’] == 5 && $_POST[’day’] <= 20)){
$sign = “Taurus”;
} elseif(($_POST[’month’] == 5 && 21 <= $_POST[’day’]) OR ($_POST[’month’] == 6 && $_POST[’day’] <= 21)){
$sign = “Gemini”;
} elseif(($_POST[’month’] == 6 && 22 <= $_POST[’day’]) OR ($_POST[’month’] == 7 && $_POST[’day’] <= 22)){
$sign = “Cancer”;
} elseif(($_POST[’month’] == 7 && 23 <= $_POST[’day’]) OR ($_POST[’month’] == 8 && $_POST[’day’] <= 22)){
$sign = “Leo”;
} elseif(($_POST[’month’] == 8 && 23 <= $_POST[’day’]) OR ($_POST[’month’] == 9 && $_POST[’day’] <= 22)){
$sign = “Virgo”;
} elseif(($_POST[’month’] == 9 && 23 <= $_POST[’day’]) OR ($_POST[’month’] == 10 && $_POST[’day’] <= 23)){
$sign = “Libra”;
} elseif(($_POST[’month’] == 10 && 24 <= $_POST[’day’]) OR ($_POST[’month’] == 11 && $_POST[’day’] <= 22)){
$sign = “Scorpio”;
} elseif(($_POST[’month’] == 11 && 23 <= $_POST[’day’]) OR ($_POST[’month’] == 12 && $_POST[’day’] <= 21)){
$sign = “Sagittarius”;
} elseif(($_POST[’month’] == 12 && 22 <= $_POST[’day’]) OR ($_POST[’month’] == 1 && $_POST[’day’] <= 20)){
$sign = “Capricorn”;
}
echo $sign;
Then we just visit the sign_form.php and input the birthday and click submit,we will get the sign according the birthday.