UCC Posted June 10, 2007 Share Posted June 10, 2007 Can someone help me with working with apostrophes? Desc: If DESC has an apostrophe, the DESC is getting truncated in the text field at the point of the apostrophie. What's the best way to deal with this? Feel free to talk about any text box/apostrophe related PHP issues here. In my forums, I'm simply using a string replace to remove them completely cause they always seemed to cause issues Quote Link to comment Share on other sites More sharing options...
Decepti0n Posted June 10, 2007 Share Posted June 10, 2007 Re: Text Boxes and Apostrophes echo '<td>Desc:</td><td><input type="text" size="20" name="mdesc" maxlength="250" value="'.$msn['DESC'].'"></td>'; Quote Link to comment Share on other sites More sharing options...
UCC Posted June 10, 2007 Author Share Posted June 10, 2007 Re: Text Boxes and Apostrophes Looked promising with the switch from my print to the echo and using the truncation for the variable rather than {} but the display value is still being truncated. Immediately before the output, I do a print_r($msn) and the DESC variable is correct but in the text box, it is truncated Quote Link to comment Share on other sites More sharing options...
UCC Posted June 13, 2007 Author Share Posted June 13, 2007 Re: Text Boxes and Apostrophes Good call L1. Thanks. Just one small change I needed $query = htmlentities($_POST['mdesc'], ENT_QUOTES); 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.