php - How to capture exact text input in textarea and display it in a table? -
i creating programming forum , having trouble containing retrieved text database. textarea looks this
<textarea name = "posttext" style = "width: 90%; height:480px; resize:none; direction: ltr; unicode-bidi: bidi-override;text-align:left;"required> </textarea>
unicode-bidi: bidi-override captures code how entered can not make word-wrap function correctly when using them both. first question how can capture exact text in textarea , and display in table. td tag looks this
<td style = "margin:0 auto; text-align:left;"><pre>'.htmlspecialchars($post_).'</pre></td>
the pre tag displays text how entered not wrap correctly , overflows container.
how capture exact text input in textarea , display in table?
i'd recommend storing store (just insert table is), , when display text got database, output this:
<td style = "margin:0 auto; text-align:left;">'.nl2br($post_).'</td>
the php nl2br
function converts line-breaks (that stored in db) new-line html tags.
Comments
Post a Comment