Good day sir,
I have a problem i hope you can help me solve.
I developed a program using dreamweaver and phpMyAdmin.
The program works well on my local server but when i upload to my webserver it gives the following errors
Notice: Undefined index: startyear in /hsphere/local/home/trutech/thirdeyengr.com/admin/addsession.php on line 32
Notice: Undefined index: startmonth in /hsphere/local/home/trutech/thirdeyengr.com/admin/addsession.php on line 32
Notice: Undefined index: startday in /hsphere/local/home/trutech/thirdeyengr.com/admin/addsession.php on line 32
Notice: Undefined index: endyear in /hsphere/local/home/trutech/thirdeyengr.com/admin/addsession.php on line 33
Notice: Undefined index: endmonth in /hsphere/local/home/trutech/thirdeyengr.com/admin/addsession.php on line 33
Notice: Undefined index: endday in /hsphere/local/home/trutech/thirdeyengr.com/admin/addsession.php on line 33
the line contains the following statements
$startdate = $_POST[‘startyear’]."-".$_POST[‘startmonth’]."-".$_POST[‘startday’];$enddate = $_POST[‘endyear’]."-".$_POST[‘endmonth’]."-".$_POST[‘endday’];
the html is
<tr valign="baseline">
<td nowrap="nowrap" align="right">Start Date:</td>
<td>
<? //////////////////////////////////menus for selection of date
$months = array(1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August', 9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December');
print '<select name="startmonth">';
// One choice for each element in $months
foreach ($months as $num => $month_name)
{
print '<option value="' . $num . '">' . $month_name ."</option>n";
}
print "</select> n";
print '<select name="startday">';
// One choice for each day from 1 to 31
for ($i = 1; $i <= 31; $i++)
{
print '<option value="' . $i . '">' . $i ."</option>n";
}
print "</select> n";
print '<select name="startyear">';// One choice for each year from last year to five years from now
for ($year = date('Y') -1, $max_year = date('Y') + 5; $year < $max_year; $year++)
{
print '<option value="' . $year . '">' . $year ."</option>n";
}
print "</select> n";
?> </td> </tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">End Date:</td>
<td>
<?
//menus for selection of date
$months = array(1 => 'January', 2 => 'February', 3 => 'March', 4 => 'April', 5 => 'May', 6 => 'June', 7 => 'July', 8 => 'August', 9 => 'September', 10 => 'October', 11 => 'November', 12 => 'December');
print '<select name="endmonth">';
// One choice for each element in $months
foreach ($months as $num => $month_name)
{
print '<option value="' . $num . '">' . $month_name ."</option>n";
}
print "</select> n";
print '<select name="endday">';
// One choice for each day from 1 to 31
for ($i = 1; $i <= 31; $i++)
{
print '<option value="' . $i . '">' . $i ."</option>n";
}
print "</select> n";
print '<select name="endyear">';
// One choice for each year from last year to five years from now
for ($year = date('Y') -1, $max_year = date('Y') + 5; $year < $max_year; $year++)
{
print '<option value="' . $year . '">' . $year ."</option>n";
}
print "</select> n"; ?></td> </tr>
===========================================
Please i would appreciate if you can help identify what the problem is
MOD EDIT: Added code tags