Jump to content
  • Advertisement

Archived

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

BlindTechie

PHP Problem, help!

This topic is 5355 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!