pocobueno1388 Posted September 12, 2006 Share Posted September 12, 2006 I have a site where users can put a small picture as their username. There is an area where you can change your username, and a user can input something like:<img src="image_URL" border=0>And that exact information as they typed it will be submitted in the database in their 'username' field. The problem I am having is I have an input box that shows their current username, then they can highlight it and change it.If the user has an image as their name, obviously the input box can only display text and not the image. I would like to make the input box display:<img src="image_URL" border=0>EXACTLY like that. How do I just select that from the db without it thinking I am trying to display an image in the input box? Here is the code I am using for the input box currently:[code]<input type=text name="username" maxlength=255 length=20 value="$player[username]">[/code]It is the value part that needs to be changed...Any help would be appreciated. Thanks XD Quote Link to comment Share on other sites More sharing options...
btherl Posted September 12, 2006 Share Posted September 12, 2006 I think that this is what you want: http://sg.php.net/manual/en/function.htmlspecialchars.phpFor example:[code]$username_encoded = htmlspecialchars($player['username']);print '<input type=text name="username" maxlength=255 length=20 value="' . $username_encoded. '">';[/code] Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted September 12, 2006 Author Share Posted September 12, 2006 Perfect =) Thank you so much. Quote Link to comment 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.