webmaster1 Posted April 9, 2009 Share Posted April 9, 2009 Hi All, I want to output from a database (that I've inputted to) without backslashes appearing. I was told in a recent thread to change the encoding of the page or to use html_entities. Outputting using stripslashes does the exact same thing. Lets say I'm outputting to a series of texboxes that I'm also using to re-input (insert) the data should the end-user need to make ammendments: <input type="text" name="landline" id="landline" value="<?php echo $landline; ?>"/> If I apply striplashes to the above value for outputting and then pick the variable back up with mysql_real_escape_string for inputting will I experience any sort of conflicts in terms of the special characters? Quote Link to comment https://forums.phpfreaks.com/topic/153395-html_entities-versus-stripslashes/ Share on other sites More sharing options...
viion Posted April 9, 2009 Share Posted April 9, 2009 No you wont because you'd only input the data through a striplashes and or other functions. When it's pulled back it will be already clean in the database and will not require any fiddling. Quote Link to comment https://forums.phpfreaks.com/topic/153395-html_entities-versus-stripslashes/#findComment-805897 Share on other sites More sharing options...
Maq Posted April 10, 2009 Share Posted April 10, 2009 Also, when you invoke stripslashes() on a variable it doesn't change the variable unless you re-assign it. It will display the $landline with stripslashes but it doesn't actually change the value. Quote Link to comment https://forums.phpfreaks.com/topic/153395-html_entities-versus-stripslashes/#findComment-806129 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.