Re:[SOLVED] [PHP] Syntax

From: Date: Sat, 14 Feb 2004 11:34:15 +0000
Subject: Re:[SOLVED] [PHP] Syntax
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-177697@lists.php.net to get a copy of this message
Thanks John, "John Nichel" <jnichel@by-tor.com> wrote in message news:402DD43E.5070007@by-tor.com... > PETCOL wrote: > <snip> > > This line is whats causing me all the greif: > > echo "<option > > > > value="$_POST["Country"];"selected>\n"$_POST["Country"];"</option>\n"; > > Parse error: parse error, expecting ','' or > > ';'' > > > > Suggestions or tutorials please ;-) > > > > Col > > > > You're wrapping the whole string in double quotes ("), not escaping the > double quotes in your form element, and using double quotes around the > array keys. Don't know why you have the semi-colons in the middle of > the string, or the new line, but try this... > > echo ( "<option value=\"" . $_POST['Country'] . "\" > selected>" . > $_POST['Country'] . "</option>\n" ); > > Read here about escaping characters, and about concatenating. > > http://us2.php.net/manual/en/function.echo.php > http://us2.php.net/manual/en/language.operators.string.php > > -- > By-Tor.com > It's all about the Rush > http://www.by-tor.com

« previous php.general (#177697) next »