Forum Moderators: coopster
echo('<p>' . $_SERVER['PHP_SELF'] . '</p>');
?>
this is my code. Whenever I try to view it in the Browser I am getting the following error:
Warning: Undefined variable: _SERVER in c:\inetpub\wwwroot\phpincludes\includes\simpleParagraph.php on line 3
I'm pretty new at the whole PHP game, but I have tried finding answers on here already and at the sitepoint forums too with no joy, any pointers would be greatly appreciated.
my PHP version is 4.0.4 - I take it an upgrade is highly advisable?
using $HTTP_SERVER_VARS seems to have done it though, except when I want to get DOCUMENT_ROOT like this:
<?php
echo('<p>'.$HTTP_SERVER_VARS['PHP_SELF'].'</p>');
?>
This is giving me the following error:
Warning: Undefined index: DOCUMENT_ROOT in c:\inetpub\wwwroot\phpincludes\includes\simpleParagraph.php on line 3
any ideas?
I think the biggest advantage is the object oriented differences though there are a few functions that I like in php 5.
so if you do a ton of OOP scripts then 5 would be better, aside from that it doesn't matter but getting off of 4.0.4 is most definitely strongly advised.