Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
This has been a challenge .. it may be simple to you, but I'm leanring.
My index page goes like such :Code: Select all
<html>
<head>
<title>Birthday</title>
</head>
<body>
<?php
$m=1;
$y = date("Y");
$yy = $y -99;
$months = array("January","February","March","April","May","June","July","August","September","October","November","December");
?>
<form action="test.php" method="POST">
<table border=4>
<tr>
<td>
<select name="bmon">
<?php
foreach ($months as $month) {
echo "<option value=" .$m. ">" .$month. "</option>";
$m++;
}
?>
</select>
</td>
<td>
<select name="bday">
<?php
for($d = 1;$d <= 31;$d++) {
echo "<option value=" .$d.">".$d."</option>";
}
?>
</select>
</td>
<td>
<select name="byear">
<?php
while ($yy <= $y) {
echo "<option value=" .$y.">".$y."</option>";
$y--;
}
?>
</select>
</td>
</tr>
<tr>
<td colspan=3 align="center">
<input type="submit" value="submit">
</td>
</tr>
</table>
</form>
</body>
</html>Code: Select all
<?php
if (checkdate( $bmon, $bday, $byear) ) {
header("Location: passed.php");
} else {
header("Location: index.php");
}
?>1) If it does fail how can I tell the user that it failed?
2) When I do put a valid date in it just goes back to the index page instead of passed.php
3) Once I get this to work .. I'll make sure that you can put a date in more current then the current date.
I know checkdate is working .. because if I use var_dump with it I get bool(true or false) pending on the date.
I looked over the tuts .. didn't really see anything that suits what I'm trying to do. Or am I going about this all wrong?
So .. kindly walk me through this! I'm saving all this stuff so I can be embarrassed on how stupid I was in my learning days!
Thanks again!
Handler
feyd | Help us, help you. Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]