php - Database text in textarea shows <p> -
my situation following:
i have database "description" column of type text. in html, column represented textarea. when i'm entering text:
then, how stored in database:
then, on front-end:
as can see, displaying < p > tags.
this code showing textarea on both front-end back-end:
echo '<textarea class="form_textarea os-input" name="' . $this->getname() . '" id="form_' . $this->getname() . '"'; $required = $this->getrequired(); if(isset($required) && $required == true) { echo ' required'; } echo '>' . $this->getvalue() . '</textarea>';
- both front-end , back-end use same database, in front-end looks different.
- both front-end , back-end use same code showing form (and thereby textarea)
- there no special escaping @ all. no use of nl2br or etc.
- i'm using wordpress
this weird part: when print on screen, without textarea:
- the back-end shows: "this text", in chrome dev tool, see newlines, no < p >.
- the front-end shows: "this(newline)is(newline)some text", in chrome dev tool, see < p > tags.
the code getting values database same in front-end , back-end. can't "client side" thing right?
Comments
Post a Comment