Web Hosting Talk







View Full Version : PHP + mySQL Paragraph problems....


crEA-tEch
11-29-2003, 06:00 PM
Sorry about the title... may be mis-leading about my problem but I dunno how to explain it properly so here goes... !

Basically I have a form... that form is posting an article into a database...

Sounds simple? Yeah it is.... but heres the problem...

In textbox where I enter the article, I press enter and i need it to somehow simulate the "<p>" tag in html... i submit the article and it goes into the database.

When i recall this text from the database onto a page, it doesnt have the paragraphs in it like when i entered it... BUT, if I call it into a textbox, it will go back to the way it started.. in paragraphs..

I know there is a way to make it so there is paragraphs when u recall it onto a page... because this forum does it!!!!

any ideas?

PS - im adding the article after doing these to it:

$pagetext = addslashes($pagetext);
$pagetext = htmlspecialchars($pagetext);

thanks guys :D

Jasber
11-29-2003, 06:15 PM
Try nl2br()

crEA-tEch
11-29-2003, 06:35 PM
thanks dude it works!!

(L)