Hello guys i've coded a death calculator but it looks like some is wrong with my month switch statement here's the code
Oh and if you want a demo please go to jnrWap
PHP Code:
<?php
echo '<html>
<head>
<title>jnrWap.co.cc | Death calculator results</title>
<link rel="stylesheet" type="text/css" href="../downloads/style.css"/>
</head>
<body>
<div class="title"><img src="../logo.png" alt="jnrWap"/></div>';
$fname = $_POST['fname'];
$dd = $_POST['dd'];
$mm = $_POST['mm'];
$yy = $_POST['yy'];
$sname = $_POST['sname'];
$city = $_POST['city'];
$place = $_POST['place'];
$yr = date("Y");
$yr1 = date("Y") + 1;
echo '<div class="dl">';
include("../admob.php");
echo '</div><div class="dl2">';
if($dd > 31 || $mm > 12 || $yy > $yr)
{
echo 'You entered a wrong Date of birth <a href="index.php">start again</a><br>';
}
else
{
echo $fname.' '.$sname.' Will die on this day ';
$dday = rand(1,28);
echo $dday.' ';
/*Problem must be somewhere around here, instead of getting a month displayed i get a month and a number like 14 March3 2014 instead of 14 March 2014
*/
$dmnth = rand(1,12);
switch($dmnth)
{
case 1 : echo 'January';
break;
case 2 : echo 'February';
break;
case 3 : echo 'March';
break;
case 4 : echo 'April';
break;
case 5 : echo 'May';
break;
case 6 : echo 'June';
break;
case 7 : echo 'July';
break;
case 8 : echo 'August';
break;
case 9 : echo 'September';
break;
case 10 : echo 'October';
break;
case 11 : echo 'November';
break;
default : echo 'December';
break;
}
echo $dmnth.' ';
$dyp = $yr + 20;
$dyr = rand($yr1,$dyp);
echo $dyr.' I\'m sorry to break the news<br><div class="dl">';
}
include("../buzz.php");
echo '</div>';
include("../foot.php");
?>
Comment