RE: [PHP] Using the echo tag...

From: Date: Mon, 07 Nov 2005 22:57:30 +0000
Subject: RE: [PHP] Using the echo tag...
Groups: php.general 
Request: Send a blank email to php-general+get-225260@lists.php.net to get a copy of this message
[snip] I'm relatively new at coding PHP but I was hoping someone can help me with this. I'm trying to write the following code into my program but each time it runs, I get an error message. Can anyone help? print <<<< EOF <!-INSERT HTML HEADER HERE --> $_SERVER['PHP_SELF'] EOF; Say that was a part of a HTML Form action tag, everytime I try to run it, I get an error message am I doing something wrong or do I have to break out of the here document to use this syntax? [/snip] What's the error message you're getting? That will be most helpful in trying to diagnose the problem. Likely, though, is the fact that you're trying to output $_SERVER['PHP_SELF'] within your heredoc syntax, without wrapping it in curly braces. It should be: {$_SERVER['PHP_SELF']} See http://www.php.net/manual/en/language.types.string.php#language.types.st ring.syntax.heredoc for more info. Cheers, Pablo

« previous php.general (#225260) next »