feakazoid Posted January 28, 2009 Share Posted January 28, 2009 Hey guys, I'm fairly new to php, but i have this basic question and i do mean easy. I have an edit form that get its information from an id that is passed to it once you find the record you wanna edit. Then with the information it fills out the form, the trouble is on the input type = text fields if that field has a space in it, it will cut of there. I have done an echo of the field just to make sure its getting the data fine and it is, it has the problem when i use value = <?php echo "$a_row[0]"; ?> and if a_row[0] was say "John Smith" it would say John in the text field. Any help would be great other fields such as text areas contain the spaces fine. Thanks again guys, sorry if this is on the wrong forum. Quote Link to comment https://forums.phpfreaks.com/topic/142756-text-input-cutting-off-at-white-space/ Share on other sites More sharing options...
sasa Posted January 28, 2009 Share Posted January 28, 2009 value=" <?php echo $a_row[0]; ?>" Quote Link to comment https://forums.phpfreaks.com/topic/142756-text-input-cutting-off-at-white-space/#findComment-748287 Share on other sites More sharing options...
PFMaBiSmAd Posted January 28, 2009 Share Posted January 28, 2009 Edit: Basically the same info+ as above ^^^ Correct HTML has quotes around the value="..." value. You also need to use htmlentities on the data before/when you echo it so that HTML special characters in it won't break the HTML. And you don't need double-quotes around a php variable unless you have something else inside of the string. value = "<?php echo htmlentities($a_row[0]); ?>" Quote Link to comment https://forums.phpfreaks.com/topic/142756-text-input-cutting-off-at-white-space/#findComment-748288 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.