Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jan 2003
    Location
    U.S.A
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Undefined variable error

    I'm running Apache on the Windows 2000 box, and often getting this error lately. Does anyone had the same problem as I do? By the way, the PHP script works fine. I'm also test some of PHP script on the Windows XP box, it does not giving me "Underfined Variable" error. Anyone has any solution or suggestion, please share. Thanks

    TheCut

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Apparently you have different error reporting levels set in your PHP setups. Look into each php.ini, there should be a section named "error reporting" or something similar and change that to suit your needs. Of course, this means changing to E_ALL, because good scripts should run without any notices appearing. ;

    You're "real" error is that you use a variable but forgot to check if it does exist at all. The isset() function helps you overcome this problem, you can use it to check the existence of a variable and if necessary, assign a default value.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •