Re: What makes _SERVER stop working
| From: | Ben Dunlap | Date: | Mon, 03 Aug 2009 18:43:46 +0000 |
| Subject: | Re: What makes _SERVER stop working | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-296230@lists.php.net to get a copy of this message | ||
Miller, Terion wrote:
> if ($_SERVER['SCRIPT_FILENAME'] = "browse.php" ) {
You're using the assignment operator above ('=') instead of the comparison
('=='). If that's not simply a typo that entered the code when you composed
your email, then that's the source of your problem.
You might consider putting the literal side of your comparisons on the left of
the operator. Using the example above you could write:
if ("browse.php" == $_SERVER['SCRIPT_FILENAME']) {
This way if you accidentally use the assignment operator, PHP will give you a
parse error before it even tries to execute the script.
Ben