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,
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php