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!
The PHP pages used to work under PHP 4.0.6 but now that we moved to PHP version 5.0.3, I'm getting the error "Notice: Undefined variable" on almost all of my PHP pages. Will anyone tell me what might be the problem here?
its a matter of different error level reporting. Its caused by using variables without intializing them first. It can be fixed by changing you error reporting level or by going back through your code and ensuring that all variables are intialized properly.
its the same in all versions of php, the difference is that when you installed 5 it had a higher level of error reporting.
To initialize variables, you just set it equal to something. You will get the notice if you do something like $string .= "blah"; without first doing $string = "Something";
In php.ini set error reporting to E_ALL & ~E_NOTICE
look for a line that says:
error_reporting = E_ALL
and just make it
error_reporting = E_ALL & ~E_NOTICE
How do I test if the variable sltScholarship is initilized or not? I'm having an error on this sltScholarship variable when coming from a differnt page to this particular page. Now, once I'm in this page I no longer receive this error because the page is submitting to self.