Hi, I am trying to retrieve a value from a MySQL database and display it using PHP in a text box. When I use <input type="text" value="<?= $value?>"/> only the first part of $value is displayed. Anything after a space is truncated. If i print $value elsewhere, it prints the whole string correctly. Can anyone help me with this. Thanks Regards, Vinaya
Msg#: 2836 posted 10:40 pm on Feb 12, 2004 (gmt 0)
Hi, I tried using htmlspecialchars, but that doesnt seem to help. The value of $value is 'Hello there', no double quotes anywhere, only hello is displayed. I think i need to use a text area instead of a text. Will tell you the result once i do that. Thanks for ur suggestions! Vinaya
Msg#: 2836 posted 11:44 pm on Feb 12, 2004 (gmt 0)
Well that's very strange because everything looks good to me. Hard to tell if it's the php or the html. What does the generated source code look like? When you print the $value is that right before the input tag?
BTW, you should have a name="something" in the input tag as well.
Msg#: 2836 posted 11:54 pm on Feb 12, 2004 (gmt 0)
Hi, thanks for that reply..i looked at the source code being generated and realised what was going wrong.. <input type="text" name="cardName" size="30" maxlength="50" value=v nat> i had value=<?$value?> instead of value="<?$value?>" thats why it was displaying only the first part. Thanks for the help. Vinaya