01hanstu Posted March 13, 2012 Share Posted March 13, 2012 Hi, I am trying to get the form field to echo a php variable. The problem is that the form is 'Printed' via php. print "<td width=\"300\" valign=\"top\"><input type=\"text\" name=\"usr\" value=\"i.e. JBloggs \" onfocus=\"if(!this._haschanged){this.value=''};this._haschanged=true;\" tabindex=\"1\"></td>"; Instead of the value being i.e. JBloggs have it echo the $name variable. Any input would be appreciated. Link to comment https://forums.phpfreaks.com/topic/258848-php-echo-within-a-print/ Share on other sites More sharing options...
smerny Posted March 13, 2012 Share Posted March 13, 2012 echo "<td width=\"300\" valign=\"top\"><input type=\"text\" name=\"usr\" value=\"".$name."\" onfocus=\"if(!this._haschanged){this.value=''};this._haschanged=true;\" tabindex=\"1\"></td>"; Link to comment https://forums.phpfreaks.com/topic/258848-php-echo-within-a-print/#findComment-1326959 Share on other sites More sharing options...
Vel Posted March 13, 2012 Share Posted March 13, 2012 echo "<td width=\"300\" valign=\"top\"><input type=\"text\" name=\"usr\" value=\"".$name."\" onfocus=\"if(!this._haschanged){this.value=''};this._haschanged=true;\" tabindex=\"1\"></td>"; Don't even need to use ".$name.", can just put $name straight in there. Link to comment https://forums.phpfreaks.com/topic/258848-php-echo-within-a-print/#findComment-1327026 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.