I've gone as far as I can and need serious help !

Here are the calculations I need to perform on a birth date.

Male

add together the last two digits of the $year. If result is 10 or more, add the two digits together to reduce them to a single digit. Substract from 10. If answer is 5 use the digit 2. (if 5 ==2)

If $year is 2000 or more subtract 9 (instead of 10)

Female

add together the last two digits of the $year. If result is 10 or more, add the two digits together to reduce them to a single digit then add 5. If the result is 10 or more, add the two digits and reduce them to a single number.

If the answer is 5, use the digit 8 (if 5 == 8).

If year is 2000 or more add 6 (instead of 5)

**********

input.html

<form method="post" action="lucky.php">

<input type=text value="" name="name">

<input type=text value="" name="gender">

<input type=text value="" name="byear">

<input type="submit" value="submit" name="button">

lucky.php

<?php

if ($gender == "male") {

($byear ) // need to split last 2 digits into 2 variables $last1, $last2

($last1 + $last2 = $two)

if ($two > 9) // need to split $two into 2 variables, $first, $second

($first + $second = $third)

if ($byear > 1999)

(9 - $third = $md)

else (10 - $third = $md)

}

if ($md == 5) { // if $md equals 5

($md == 2) ; // $md equals 2

}

}

if ($gender == "female") {

($byear ) //

($last1 + $last2 = $two)

if ($two > 9) // need to split into two variables, $first, $second

($first + $second = $third)

if ($byear > 1999)

(6 + $third = $fd)

else (5 + $third = $fd)

if ($two > 9) // split into two variables again, $first2, $second2

($first2 + $second2 = $third)

}

if ($fd == 5) {

($fd == 8 );

}

}

If ($gender == $md) {

echo "Dear $name";

echo "$md";

echo "is your lucky number"

else

echo "Dear $name";

echo "$fd";

echo "is your lucky number";

}

}

?>

Tweet This+ 1 thisPost To Linkedin