Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 203
  • Last Modified:

PHP and SQL Server carriage returns

Hi,
I have a text area that accepts user input and submits it to a SQL Server database. Later on, that information is pulled out of the database and printed on the web browser. My problem is that in this process the carriage returns are disappearing. The text that appears in the browser is all compacted. What can I do to fix this problem?
0
alateos
Asked:
alateos
  • 2
  • 2
1 Solution
 
_Marcel_Commented:
Are you sure the returns are disappearing? Try to use nl2br() to change the new lines to <br>'s. HTML can't show carriage returns...
0
 
alateosAuthor Commented:
What is nl2br()
0
 
_Marcel_Commented:
It means "new line to break". Read this: http://www.php.net/nl2br

You need to convert the carriage returns to HTML-breaks...
0
 
alateosAuthor Commented:
it works perfectly thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now