Jump to content

[SOLVED] Undefined Variable Silliness


ricosalomar

Recommended Posts

well where to start

A) You are trying to create an output with no output function defined

B) You didn't finish a phrase

C) Had that been a complete phrase you didn't use a semi colon

D) You used Short tags

try

<html>
<a href="<?php echo $_SERVER['PHP_SELF'];?>"?var=foo">Bar</a>
</html>

 

Undefined variable is a Notice , yes?

Not a Fatal Error, not a Warning.

 

IMO, PHP's error reporting level is too high.

Undefined variables could be checked all the time in normal situations, and shouldn't really be sent to the screen unless you really intend it to.

 

Dig my reply to this post, where the problem may have been that the level was too low.

http://www.phpfreaks.com/forums/index.php/topic,170596.0.html

 

error_reporting(7) (same as error_reporting(E_ERROR | E_WARNING | E_PARSE) )

is a good level for reporting true problems, and not silly notices

Bibby, you are correct, they are notices, not errors. But my log is so full of them, it'd be nice to slim it down a bit.

 

btherl, the log points to that code, by line #. My code is loaded with similar calls to PHP_SELF.

 

Thorpe, I'll try that.

 

cooldude832, this is the way it should look, thanks.

 

BTW, the page(s) render correctly, and function correctly. I just wanted to get to the bottom of the logs.

Thank you all for your help.

-Rico

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.