form call
Posted: Thu Oct 14, 2004 8:29 pm
twigletmac | Help us, help you. Please use
Notice: Undefined index: month in C:\Mywork\calendar\calendar.php on line 4
Notice: Undefined index: year in C:\Mywork\calendar\calendar.php on line 4
Sorry about that, i just need some1 can explain to me. i realise that the browser produce the 2 notice to me about the undefined index. May i knw the program having error when it suppose to call back from oringinal form, PHP_SELF or i just need to change the php.ini to
error_reporting = E_ALL & ~E_NOTICE this mode.?
If the program having error to call from the form, how do i modify ?
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]Code: Select all
<?php
if(!checkdate($_POSTї'month'], 1 , $_POSTї'year']))
{
$nowArray = getdate();
$month = $nowArrayї'mon'];
$year = $nowArrayї'year'];
}
else
{
$month = $_POSTї'month'];
$year = $_POSTї'year'];
}
$start = mktime(12,0,0,$month,1,$year);
$firstDayArray = getdate($start);
?>
<html>
<head>
<title>
<?php print "Calendar:" .$firstDayArrayї'month']. " ".$firstDayArrayї'year'] ?> </title>
</head>
<body>
<form method="post" action="<?php print "$_SERVERїPHP_SELF]"; ?>">
<select name="month">
<?php
$months = Array("January","February","March","April","May","June","July","August","September","October","November","December");
for($x=1; $x<=count($months); $x++)
{
print "\t<option value="$x"";
print ($x == $month)?" SELECTED":"";
print ">".$monthsї$x-1]."\n";
}
?>
</select>
<select name="year">
<?php
for($x=1980; $x<=2010;$x++)
{
print "\t<option";
print ($x == $year)?" SELECTED":"";
print ">$x\n";
}
?>
</select>
<input type = "submit" value="GO!">
</form>
</body>
</html>Notice: Undefined index: month in C:\Mywork\calendar\calendar.php on line 4
Notice: Undefined index: year in C:\Mywork\calendar\calendar.php on line 4
Sorry about that, i just need some1 can explain to me. i realise that the browser produce the 2 notice to me about the undefined index. May i knw the program having error when it suppose to call back from oringinal form, PHP_SELF or i just need to change the php.ini to
error_reporting = E_ALL & ~E_NOTICE this mode.?
If the program having error to call from the form, how do i modify ?