this seems like a really easy question, which is why only i can't figure it out!
but on my site, users can input text using a text box and it is saved in a database. however, when it comes to retrieving it and displaying on a page, the paragraph formatting has gone, and if users have seperated text using line spaces, it appears as just one long blob??
any ideas on how i can fix this.
cheers
maintaining formatting - forms to database
Moderator: General Moderators
-
ukeventguide
- Forum Newbie
- Posts: 2
- Joined: Sat Sep 27, 2003 8:58 am
Code: Select all
<?
$textdata = nl2br($_post['usertext']);
$query = "INSERT INTO db.table (field_name) VALUES ($textdata)";
?>now the retrived value will have line breaks as user had put..
-
ukeventguide
- Forum Newbie
- Posts: 2
- Joined: Sat Sep 27, 2003 8:58 am