DaveC426913
Programmer
I guess I'm not quite getting this. I'll start from the top.
I'm upgrading PHP code from 4.2 to 4.4. One of the big differences is that register globals defaults to off.
I've temp. switched it to on in php.ini (then restarted Apache) to ensure that the code is running OK, now I'm switching it off again.
I've set a flag on the page:
error_reporting (E_NOTICE);
OK, now I'm getting a notice that tells me it's not defined:
Notice: Undefined index: mes in /usr/local/ on line 78
Here's the code:
<td<?php echo "<a href=\"select_date.php?mes=".($mes-1)."&fm=$fm&fld=$fld\"><<</a>"; ?></center></td>
<td><center>click day to select</center></td>
<td><center><?php echo "<a href=\"select_date.php?mes=".($mes+1)."&fm=$fm&fld=$fld\">>></a>"; ?></center></td>
</tr></table></td>
...
<?php
$newCal->displayMonth($mes);
?>
Good so far. It actually trips over it 3 times, each time it encounters $mes
So, I put in a new line:
$mes=$_GET['mes'];
But it doesn't work. I now that that same Notice on THAT line.
I tried this too:
$mes=$HTTP_GET_VARS['mes'];
No luck. Why am I getting an 'unidefined index: mes' error?
I'm upgrading PHP code from 4.2 to 4.4. One of the big differences is that register globals defaults to off.
I've temp. switched it to on in php.ini (then restarted Apache) to ensure that the code is running OK, now I'm switching it off again.
I've set a flag on the page:
error_reporting (E_NOTICE);
OK, now I'm getting a notice that tells me it's not defined:
Notice: Undefined index: mes in /usr/local/ on line 78
Here's the code:
<td<?php echo "<a href=\"select_date.php?mes=".($mes-1)."&fm=$fm&fld=$fld\"><<</a>"; ?></center></td>
<td><center>click day to select</center></td>
<td><center><?php echo "<a href=\"select_date.php?mes=".($mes+1)."&fm=$fm&fld=$fld\">>></a>"; ?></center></td>
</tr></table></td>
...
<?php
$newCal->displayMonth($mes);
?>
Good so far. It actually trips over it 3 times, each time it encounters $mes
So, I put in a new line:
$mes=$_GET['mes'];
But it doesn't work. I now that that same Notice on THAT line.
I tried this too:
$mes=$HTTP_GET_VARS['mes'];
No luck. Why am I getting an 'unidefined index: mes' error?