Page 1 of 1

Undefined variable error message

Posted: Thu Sep 19, 2002 8:41 pm
by Fari
Hi guys

I'm running apache 1.3, with PHP 4.2.2 on a Win2000 box. The following short code

<HTML>
<HEAD>
<TITLE>Get column number</TITLE>
</HEAD>
<BODY>
<BR>
<BR>
<form action="get_col_names.php" "method="get">
<font face="arial" size="2" color="#1c651c">Enter column number : </font>
<input type="text" name="colno" size="3" value="0"><BR>
<input type="submit" value="Enter">
</form>

</BODY>
</HTML>

correctly passes colno in the URL to get_col_names which looks like this:

<HTML>
<HEAD>
<TITLE>Get column names</TITLE>
</HEAD>
<BODY>
<?
echo"<font face=\"arial\" size=\"2\" color=\"#1c651c\">Column number : " . $colno . "</font>" ;
?>
</BODY>
</HTML>

but this generates the following error message and returns no value in colno :

Notice: Undefined variable: colno in c:\program files\apache group\apache\htdocs\test\get_col_names.php on line 7

Running the same on another webserver the script returns the correct value with no error message. Obviously my config is different from the other webserver's??? Any aideas why??

Thanks - Fari

Posted: Thu Sep 19, 2002 9:50 pm
by JPlush76

Posted: Fri Sep 20, 2002 2:25 am
by Takuma
Have you set the error_reporting to "E_ALL"?

Posted: Fri Sep 20, 2002 6:35 am
by Fari
Thanks a mill guys! Solved my problem :D