Annoying Errors

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!

Moderator: General Moderators

Post Reply
ct2k7
Forum Newbie
Posts: 3
Joined: Wed Oct 01, 2008 7:16 pm

Annoying Errors

Post 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
User avatar
The_Anomaly
Forum Contributor
Posts: 196
Joined: Fri Aug 08, 2008 4:56 pm
Location: Tirana, Albania

Re: Annoying Errors

Post 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?
ct2k7
Forum Newbie
Posts: 3
Joined: Wed Oct 01, 2008 7:16 pm

Re: Annoying Errors

Post by ct2k7 »

$sub is being defined in an isset.

Moving on from the errors as I've fixed most of them.... WSoD! :(
ct2k7
Forum Newbie
Posts: 3
Joined: Wed Oct 01, 2008 7:16 pm

Re: Annoying Errors

Post by ct2k7 »

Updated code is here -

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