emehrkay Posted March 21, 2007 Share Posted March 21, 2007 I'm really having a brain fart right now on how to fix this. My return data is: (I have nothing to do with how the og person choose to input this) <font color="#800080"><b>CASE</b></font> and I am setting the value of a input text form field equal to that return $input = "<input type=\"text\" name=\"queOpt". $i ."\" value=\"". $this->_queArr[$i] ."\" />"; im lost on how to fix this. addslashes doesnt make sense - maybe it is the double quote thing Link to comment https://forums.phpfreaks.com/topic/43700-brain-fart-return-data-breaking-input-field/ Share on other sites More sharing options...
per1os Posted March 21, 2007 Share Posted March 21, 2007 Yea, addslashes is not right. $font = '<font color="#800080">CASE</font>'; $font = str_replace('"', """, $font); $input = "<input type=\"text\" name=\"queOpt". $i ."\" value=\"". $font ."\" />"; Maybe the quote deal will work, I am not sure if that is the right ascii, but yea. Link to comment https://forums.phpfreaks.com/topic/43700-brain-fart-return-data-breaking-input-field/#findComment-212156 Share on other sites More sharing options...
kenrbnsn Posted March 21, 2007 Share Posted March 21, 2007 You want to use the htmlentities() function with the ENT_QUOTES option. <?php $input = '<input type="text" name="queOpt'. $i .'" value="'. htmlentities($this->_queArr[$i],ENT_QUOTES) .'" />'; ?> Ken Link to comment https://forums.phpfreaks.com/topic/43700-brain-fart-return-data-breaking-input-field/#findComment-212158 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.