Page 1 of 1

Help with a line of code

Posted: Wed Feb 26, 2003 8:50 am
by nigma
I am having trouble with this line of code:
echo("Unapreciated person #$c: <input type=\"text\" name=ename$c value={$_POST['ename'.$c]}><br><br>");

This will display the first word the user typed into that input box on the last page but will not display any other words after a space.

Anyone know how to make it so this line will do the same thing just will print everything the user typed ( in the input box on the last page ) into another input box?

Thanks for all help provided.

Posted: Wed Feb 26, 2003 8:55 am
by volka
that's why you should quote any property of an html-element.
If not, someone dislikes me and enters Volker Krause you have

Code: Select all

Unapreciated person #1 &lt;input type="text" name=ename1 value=Volker Krause&gt;
and there's no way for the client to determine that Krause has anything to do with name.

Code: Select all

echo 'Unapreciated person #', $c, ': <input type="text" name="ename', $c, '" value="', $_POST['ename'.$c], ' /><br /><br />';

Posted: Wed Feb 26, 2003 8:59 am
by nigma
Still just get the first word of what is entered in previous input box. Everything else is either cut off or not visible.

Posted: Wed Feb 26, 2003 9:00 am
by volka
what's the output as seen by the client (source view of the browser)?

Posted: Wed Feb 26, 2003 9:01 am
by nigma
In the input box where the text from previous input box was supposed to be it says( when I view source ) just the first word as the value.

Posted: Wed Feb 26, 2003 9:12 am
by volka
so even in the page source (menu->view->"page source" or similar) the other words are missing?
can you please post that code-snippet?