PHP using php var in html

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Freak

    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!




  • Alvaro G Vicario

    #2
    Re: PHP using php var in html

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

    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
    --

    Comment

    • Freak

      #3
      Re: PHP using php var in html

      Thanks

      "Alvaro G Vicario" <alvaro_QUITAR_ REMOVE@telecomp uteronline.com> wrote in
      message news:1ojp5hfnxf qe6.sxrxxbqwspw b.dlg@40tude.ne t...[color=blue]
      > *** Freak wrote/escribió (Wed, 06 Oct 2004 14:35:35 GMT):[color=green]
      > > $mystring= "part1 part2 part3" // remark the spaces!
      > > <input type="text" name="test" size="50" value=<?echo ($mystring);?>>[/color]
      >
      > 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
      > --[/color]


      Comment

      Working...