PHP question: PHP_SELF, $_SERVER['PHP_SELF']?

  • Thread starter Thread starter aondrea S
  • Start date Start date
A

aondrea S

Guest
When I use this code:

----------------------------------------------------------------------------
<?php
require('inc_rate.php');
getComments("1");
submitComments("1","$PHP_SELF");

?>
-----------------------------------------------------------------------------

I get this error:
Notice: Undefined variable: PHP_SELF


when I use this code:
------------------------------------------------------------------------------------------------
<?php
require('inc_rate.php');
getComments("1");
submitComments("1","$_SERVER['PHP_SELF']");

?>
----------------------------------------------------------------------------------

I get this error:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'

How can I keep from getting this last error?
For any one who encounters this similar problem, I removed the quotes around $_SERVER['PHP_SELF'] and the error was removed!

So next time I get an error like this I'll know to check the syntax!
 
Back
Top