Wells-it.com - Web Hosting

forms - text to html on submission

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

They have: 1 posts

Joined: Feb 2006

hi all

what I'm trying to do is get a comments form that submits to a database to convert the main comment to html.

At the moment any comments submit end up being just 1 big paragraph even if the user hit enter a of times.

like this topic shows up like i type it if i had done this on my system it would be like this
-----------------------------------------------------------------
what I'm trying to do is get a comments form that submits to a database to convert the main comment to html.At the moment any comments submit end up being just 1 big paragraph even if the user hit enter a of times.
---------------------------------------------------------------------

any help with this matter would be grateful.

Busy's picture
Modrater

He has: 6,157 posts

Joined: May 2001

What are using using for database etc, PHP/MYSQL, ASP/SQL .... ?

most text gets put as one long sentence unless you include nl2br() or similar

Let us know what your using and should be able to help further

<?bhb if(broken){ echo("It wasn't me Smiling "); } ?>
Learn HTML the ez way - EzHTML.net

Some people are like slinkies, they dont really serve any purpose but they still bring a smile to your face when you push them down the stairs ...

He has: 31 posts

Joined: Jan 2004

thanks dude im using php/mysql.....thanks for your help im not if its the form or the db thats does this mod..

ps. i just found my old login.

Busy's picture
Modrater

He has: 6,157 posts

Joined: May 2001

If it's just the lines your worried about use nl2br(), will add a (or ) where the \n (newline) is.

$content_from_form_after_validation = nl2br($content_from_form_after_validation);

or you could use it as part of it, like strip slashes, convert htmlspecialcharacters() ..

<?bhb if(broken){ echo("It wasn't me Smiling "); } ?>
Learn HTML the ez way - EzHTML.net

Some people are like slinkies, they dont really serve any purpose but they still bring a smile to your face when you push them down the stairs ...

He has: 31 posts

Joined: Jan 2004

ok confused sorry.. to be hoonest im surprised i manedge to do this so far.. loll and its working kind of.

i have just been trying to find out about nl2br but even though it would work how would i include it in a form? it shows you how to include it in sendmail forms but thats it.
this is a page of one of my submission pages with the theme removed. where and what exsactly would i put for nl2br to work?
-----------------------------------------------------------------

doh that was two minutes ago.. figured it out it not the form it the message on display..

thankyou very much..