<?php
$varone = "Hello World";
$str = '<input type="text" width="200px"; name="worksvr" maxlength="999" value='.$varone.' >';
echo $str;
?>
that's my php code and I want the input to have the value of $varone but for some reason when I run the code it only outputs Hello and does not include World.Any advice would really be helpful thank you in advance
I tried many things including maxlength but that did not help at all.Please any help would be useful thank you.
CodePudding user response:
What you need to do is this
<?php
$varone = "Hello World";
$str = '<input type="text" width="200px"; name="worksvr" maxlength="999" value="'.$varone.'" >';
echo $str;
?>
Note the quotes around the output of $varone