PDA

View Full Version : Notice: Undefined variable: in version 3.45



riptheriper
07-11-2005, 12:33 PM
Hi patiek,

It’s my first message to your board and first of all congratulates for such a nice work and after that I like to say, I haven't seen any other counter like yours. I have installed your counter at my PC which runs WinXp with SP2 and have an IIS server. Every thing is working fine so far but I also got error message at the top of the page which says:

Notice: Undefined variable: newline in c:\inetpub\wwwroot\xyz\counter\classes\filedb.ph p on line 150

Notice: Undefined offset: 1 in c:\inetpub\wwwroot\xyz\counter\classes\filedb.ph p on line 313

Notice: Undefined offset: 2 in c:\inetpub\wwwroot\xyz\counter\classes\filedb.ph p on line 314

Any help regarding that problem will be highly appreciated. Thanks in advanced for your help.

Patrick
07-11-2005, 02:24 PM
Using the search button is easier than making a full post:
http://www.dev-forums.com/index.php?showtopic=131

riptheriper
07-11-2005, 03:14 PM
Thanks a lot for your quick reply, but problem still persist. And one more thing I'm using filedb.php and at the line number 150 it says "Undefined variable: newline". Chmod 0666 doesn’t make any help. Now what I have to do to resolve that problem?


146 function Create_Line($data_array)
147 {
148 for ($i=0; $i<count($data_array) - 1; $i++)
149 {
150 $newline .= $data_array[$i]."|";
151 }
152 $newline .= $data_array[$i]."\n";
153
154 return $newline;
155 }

Patrick
07-11-2005, 04:04 PM
Undefined variables are the result of this really old code being scripted rather speedily.

These are not errors but rather notices, usually used by PHP developers. Your PHP error reporting settings are set too high and as a result you are receiving the notices (not errors).

To fix, simply follow the instructions (http://www.dev-forums.com/index.php?showtopic=118&st=0&#entry573 ) that I linked to for each file that is giving these errors in the script.

riptheriper
07-12-2005, 02:17 PM
Thanks a lot Patiek, now every thing works fine so far. :D