Code: Select all
$_SERVER['PHP_SELF']Code: Select all
header("Location: $_SERVER['PHP_SELF']") ; Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/.../index.php on line 19 (which is the above line)
And removing the quote works fine. Escaping the quotes with '\' also doesnt work.
As a side note, the following usage also seems to work (and so does the one with quotes around PHP_SELF)....
Code: Select all
<form action="<?php echo $_SERVER[PHP_SELF]; ?>?p=login" method="post"> Are quotes really required when using $_SERVER?
How about in the case of other reserved variables?