Re: PHP_SELF syntax

From: Date: Mon, 24 Feb 2003 00:42:14 +0000
Subject: Re: PHP_SELF syntax
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-136978@lists.php.net to get a copy of this message
What you might try is removing the single-quotes from around PHP_SELF. Before: $_SERVER['PHP_SELF'] After: $_SERVER[PHP_SELF] Another note: as far as I can tell you do not need the braces ({}) to enclose a variable within a double-quoted string. I may be wrong, but nothing I've read advocates doing this, and I've never had a problem with my code when I've written it this way. Jason Ernest E Vogelsinger wrote:
At 00:55 24.02.2003, Peter Gumbrell said: --------------------[snip]--------------------
Could someone tell me why this code prompts a parse error. I have tried it several different way. The statement is called from within a function: print "<form method=\"POST\" name=\"update_workshop\" action=\"$_SERVER['PHP_SELF']\">\n";
--------------------[snip]-------------------- When using array elements within a string you must enclose it in curly brackets, like this: print "<form method=\"POST\" name=\"update_workshop\" action=\"{$_SERVER['PHP_SELF']}\">\n"; HTH,


« previous php.general (#136978) next »