PHP using php var in html

This is a discussion on PHP using php var in html within the PHP Language forums, part of the PHP Programming Forums category; Please help! What is going wrong? $mystring= "part1 part2 part3" // remark the spaces! ..... <td > <input ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-06-2004
Freak
 
Posts: n/a
Default PHP using php var in html

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!




Reply With Quote
  #2 (permalink)  
Old 10-06-2004
Alvaro G Vicario
 
Posts: n/a
Default Re: PHP using php var in html

*** 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
--
Reply With Quote
  #3 (permalink)  
Old 10-06-2004
Freak
 
Posts: n/a
Default Re: PHP using php var in html

Thanks

"Alvaro G Vicario" <alvaro_QUITAR_REMOVE@telecomputeronline.com> wrote in
message news:1ojp5hfnxfqe6.sxrxxbqwspwb.dlg@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
> --



Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 07:59 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0