because we are on the internet.

Archives for November, 2008

get sign by birthday in php

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.

Hello people,I just wrote a small php script to get the color of your webpage changed by second,and I just want to show it to you.

Here is the code:

<html>
<head>
<title>GET YOUR COLOR</title>
<meta http-equiv=”refresh” content=”1″>
</head>
<?php
$result = rand(0,9) . rand(0,9) . rand(0,9) . rand(0,9) . rand(0,9) . rand(0,9);
?>
<body marginheight=”0px” marginwidth=”0px” bgcolor=”#<?php echo $result; ?>”>
<font color=”#FFFFFF” size=”+6″ style=”font-family:Arial, Helvetica, sans-serif “>
Backgroundcolor: #<?php echo $result; ?>
</font>
<table width=”100%” height=”100%”>
<tr>
<td>

</td>
</tr>
</table>
</body>
</html>

and here is a link,click it and you will see how to code works.

 

About Author

Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vestibulum at arcu. Integer et risus. Morbi id tellus. Integer felis. Mauris malesuada, turpis vitae facilisis euismod, dui arcu adipiscing sem, eu vulputate leo ante in lacus. Sed porta accumsan lectus. Aenean ac sem. In consequat tempus velit. Phasellus leo enim, adipiscing a, egestas nec, pretium ut, pede. Mauris sollicitudin diam et mauris. Sed quis enim vel augue egestas lobortis. Etiam tempus ipsum vel neque.