Jump to content

Archived

This topic is now archived and is closed to further replies.

chriscloyd

html + php

Recommended Posts

Okay im making a news post script it all works and enters it into the database when it displays the text it doenst come out how i put it in there unless i use html in it like

<strong> HELLO </strong><br>
How are you guys doing today?<br>

thats what it comes out as if i do it that way but i just want to be able to hit enter with out putting html into it and haveing it add the html any easy way of doing this?

Share this post


Link to post
Share on other sites
This is the only code that I know. Id bet there are better ones but...

thats what I use. You will have to addapt it to your own need.

$message = nl2br(mysql_result($result,"message"));

specificlly

$X = nl2br();

Share this post


Link to post
Share on other sites
nl2br = New Line 2 Break :)

You'll still have to do your text formatting tags like <strong> and such, but at least this way it will read the database entry with cariage returns :)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.