Page 1 of 1

Annoying Errors

Posted: Wed Oct 01, 2008 7:20 pm
by ct2k7
Hi there, I need a little help with a php script I am working on. I am fairly new to PHP, so please excuse me if I don't understand a few things.

With regards to this script here:

http://pastebin.com/d546f3dff

I am receiving a blank white page and after adding debugging options, I am left with the following notices:

Notice: Undefined variable: sub in /home/mobsters/public_html/pages/oc.php on line 50

Notice: Undefined variable: submit in /home/mobsters/public_html/pages/oc.php on line 122

Clearly, I would like to eliminate these "problems" so that my script is free from errors.

How would I go about doing this?

Thanks

Re: Annoying Errors

Posted: Thu Oct 02, 2008 12:53 am
by The_Anomaly
The great thing about, "Annoying Errors," Is that they tell you where your mistake is. On line 50, it says that $sub is undefined. So, you go to line 50, and see that $sub is defined in another conditional above it on line 42. Perhaps the conditions for this statement are not working, hence not defining your $sub and causing an error?

Re: Annoying Errors

Posted: Thu Oct 02, 2008 1:57 pm
by ct2k7
$sub is being defined in an isset.

Moving on from the errors as I've fixed most of them.... WSoD! :(

Re: Annoying Errors

Posted: Thu Oct 02, 2008 3:25 pm
by ct2k7
Updated code is here -

Added output to exit()
and completed addition of isset :)
http://pastebin.com/d5e6bd567