Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP 4 --> PHP 5 problem 1

Status
Not open for further replies.

hullaballoo

Programmer
Aug 12, 2005
8
HU
Hi!

I've just upgraded my php4 server to php 5, and I have some problems with the session and global variables.
The error message:

Notice: Undefined variable: <variable name> in <file>

Perhaps I forgot to set up something in the php.ini.
Register_globals is on.
Does anyone have some idea about this?
What did I forget to set?

thnx: hullaballoo
 
You have to distinuguish between:
1. PHP notices
2. PHP warnings
3. PHP errors
4. PHP fatal errors

In your case this is only as NOTICE. That indicates to me that the error level setting is different between your two installations. Check that and set the error reporting level to the same as in the previous install.

PHP generates a lot of output if notices are on. Many people turn that off to save space on the log files. Every uninitialzed variable produces such an output.

P.S. The register_globals should be off, just as sleipnir and all other PHP gurus preach.
 
what they said, and also perhaps you're trying to use a var that is not set? e.g.

wrong:
if ($foo == "foo") echo "bar";

right:
if (isset($foo) && $foo == "foo") echo "bar";

-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
DRJ478, thanks, you were right, there was not any "real" problem, they were just warnings.

I know that there are problems with registering globals, but it's an intranet application and the security is not the highest priority.

Thanks again!

hullaballoo
 
but it's an intranet application and the security is not the highest priority.
I don't think that;'s a good enough reason for abandoning best practices. Your company has never had someone in the office get pissed off?

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top