By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,712 Members | 1,541 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,712 IT Pros & Developers. It's quick & easy.

PHP using php var in html

P: n/a
Please help!
What is going wrong?

$mystring= "part1 part2 part3" // remark the spaces!
.....
<td >
<input type="text" name="test" size="50" value=<?echo ($mystring);?>>
</td>
.......
the text field will only show "part1" and not the rest of the string!


Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
*** Freak wrote/escribió (Wed, 06 Oct 2004 14:35:35 GMT):
$mystring= "part1 part2 part3" // remark the spaces!
<input type="text" name="test" size="50" value=<?echo ($mystring);?>>


As any basic HTML manual will tell you, you need to use quotes to surround
the value of attributes. It's recommended when there aren't spaces, and
compulsory when there are. ;-)
--
-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions
--
Jul 17 '05 #2

P: n/a
Thanks

"Alvaro G Vicario" <al******************@telecomputeronline.com> wrote in
message news:1o****************************@40tude.net...
*** Freak wrote/escribió (Wed, 06 Oct 2004 14:35:35 GMT):
$mystring= "part1 part2 part3" // remark the spaces!
<input type="text" name="test" size="50" value=<?echo ($mystring);?>>


As any basic HTML manual will tell you, you need to use quotes to surround
the value of attributes. It's recommended when there aren't spaces, and
compulsory when there are. ;-)
--
-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions
--

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.