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:

in back-end

then, how stored in database:

database storage

then, on front-end:

front-end looks

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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -