Reputation: 108
I have a strange error with my form. I always get a Daily selection with a date of 01 Jan 2000. The code for the form is this:
<!DOCTYPE html>
<html>
<body>
<form name="mainForm" action="ReportForm.php" method="post">
How Often to Generate Report:
<select id="period" onchange="Change(this);">
<option selected="selected" value="0">Daily</option>
<option value="1">Weekly</option>
<option value="2">Monthly</option>
</select>
<br />
<input type="submit" title="Submit"/>
</form>
</body>
</html>
There are 3 more dropdowns like this for month, day, and year. I might have guessed that the selected="selected" had something to do with it, but the year 2000 is not an option. The default values for theses are January, 1, and 2012. I am thoroughly confused by this, and would appreciate any help.
The PHP associated with this is:
<?php
require "Search.php";
require "Schedule.php";
Schedule( $_POST['period'],
mktime(23, 59, 59, $_POST['month'],
$_POST['day'], $_POST['year']) );
Search( "param1", "param2", "param3", "[email protected]" );
exit();
?>
Thanks,
-rusty
Upvotes: 3
Views: 11975
Reputation: 114347
Form elements require a NAME
attribute in order to be posted. You have an ID
instead.
Upvotes: 9