Search code examples
phpinstallationnotice

I have an undefined variable, but i don't know why


This is the code i have problem with: http://tutsforweb.blogspot.hu/2012/02/php-installation-script.html

Notice: Undefined variable: pre_error in C:\wamp\www\torolni\install.php
on line 110 Call Stack #TimeMemoryFunctionLocation 
10.0022297152{main}( )..\install.php:0 20.0022297824step_2( )..\install.php:13

I have the same problem,as the first commenter, but i don't know how to "close Notice message in your php ini file". What is that? Where can i find it? I use WAMP. Could it be a problem in a "real" server? (Not in localhost)

I can't go to the 3rd step because of the error. Help me please.


Solution

  • They are suggesting to not display PHP notices, but I think it is bad advice because instead of fixing possible code problems that method just hides the message. Fixing the probem would be to initiate the variable:

    function step_2(){ $pre_error = ''; //... }