PHP Problem, help!
Hi, I haven''t been able to find an answer to this anywhere... So I decided to post it here, though it''s not necessarily game related it ties into my site which will be related to it. I recently installed PHP and got it working with my Apache setup. The problem is that it''s telling me that even enviornment variables are NOT defined! 1. I thought that in PHP you didn''t have to define a variable... The following code has the following result.
Notice: Undefined variable: DOCUMENT_ROOT in c:\blah\blah\path\test.php on line 1
I don''t know what''s wrong... Can anybody help me? I''d really appreciate it. Thanks!
-Mark
In PHP you do not have to DECLARE variables. You still have to define them (unless they''re predefined).
Probably what''s happening is you are trying to use a variable which used to be a predefined variable in PHP3, but no longer is in PHP4. As PHP4 has been out for YEARS and YEARS, we should probably be using that.
Look up in the PHP manual the correct way to get the document root. It''s probably $_SERVER[''something'']
Mark
Probably what''s happening is you are trying to use a variable which used to be a predefined variable in PHP3, but no longer is in PHP4. As PHP4 has been out for YEARS and YEARS, we should probably be using that.
Look up in the PHP manual the correct way to get the document root. It''s probably $_SERVER[''something'']
Mark
php no longer brings things like that into variables because of security concerns, by default.
You COULD enable it, but its probably better to jsut use the new way of accessing those things.
You COULD enable it, but its probably better to jsut use the new way of accessing those things.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement