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 Quote Link to comment 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. Quote Link to comment 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 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.