Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add some html to text entered by user !

Status
Not open for further replies.

hisham

IS-IT--Management
Nov 6, 2000
194
Who can I add some html (<p><br>) to text entered by those users didn't know html? Must I store them in a DB and need something to translate the special html characters? Any help would be great!
 
echo &quot;<p><br>&quot;;

or

print &quot;<p><br>&quot;;

or

<?
all your script stuff...
?>
<p><br>



Nothing special... maybe some complexities on how you add them to the text, but they're all easy to display.

-Rob
 
You'll have to be a little bit more detailed about how and when an to what do you want to add some &quot;html&quot; text to!

Rizza
 
If they are inputting into a textarea then you can convert carriage returns to <br>.

$usertext = preg_replace(&quot;/\n/&quot;, &quot;<br>&quot;, $_POST['usertext']);

or something similar --BB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top