Undefined variable error message

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Fari
Forum Commoner
Posts: 42
Joined: Thu Sep 19, 2002 8:41 pm
Location: Timmins - Ontario

Undefined variable error message

Post 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
JPlush76
Forum Regular
Posts: 819
Joined: Thu Aug 01, 2002 5:42 pm
Location: Los Angeles, CA
Contact:

Post by JPlush76 »

User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Have you set the error_reporting to "E_ALL"?
Fari
Forum Commoner
Posts: 42
Joined: Thu Sep 19, 2002 8:41 pm
Location: Timmins - Ontario

Post by Fari »

Thanks a mill guys! Solved my problem :D
Post Reply