rockinaway Posted April 6, 2008 Share Posted April 6, 2008 I have a form field, and when I enter a " value, the HTML messes up as it tries to escape it. However I haven't set it to escape anywhere :S What could be the problem? Quote Link to comment Share on other sites More sharing options...
unsider Posted April 6, 2008 Share Posted April 6, 2008 Can we see some code? Or this "messed up HTML"? Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted April 6, 2008 Share Posted April 6, 2008 Use stripslashes on the server side.... echo stripslashes($_POST['form_field_with_a_quote_in_it']); http://www.php.net/stripslashes Quote Link to comment Share on other sites More sharing options...
rockinaway Posted April 6, 2008 Author Share Posted April 6, 2008 I stripped the slashes.. but now it just removes the \ and the " still does it's messing up: <tr> <td><span style="font-weight:bold;">Username:</span><br /><span style="font-size:9px;font-weight:none;">Your desired username</span></td> <td><input type="text" name="form_username" style="" value="test"=" /></td> </tr> If you look the value part.. the value messes up the HTML.. Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted April 6, 2008 Share Posted April 6, 2008 Im a bit confused..are you trying to set the value of the field to test"= ? If so, you can't use the same style quotes inside the value of an attribute as you use to enclose them. When the browser loads this, it just assumes the next double quote it comes to signifies the end of the value attribute. Either enclose it in single quotes: value='test"=' Or use the HTML character code: value="test"=" 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.