Problem with a form..

SpaceshipSpaceship
Watch

noswad

Established Member
Impact
1
Hi.

When a user registers on my site, they submit their address in a text area.

Text area code:
PHP:
<textarea name="address" cols="30" rows="6" class="header_11" id="address">Name and Address</textarea>
However, there is a problem. If I enter my address like this:

111 A Posh Street
Small Town
Smogy City
London

...when I use a PHP session to display the users address in their account it displays like this:

111 A Posh Street Small Town Smogy City London

Could anyone advise me on where the problem lies?

Thanks for reading!
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains — AI StorefrontUnstoppable Domains — AI Storefront
Sessions are generally not used to format.

However you could get it to format if you store the info into a Session
and used <br> within each that you want a new line.
 
0
•••
You should use PHP nl2br() function to convert new lines from textarea to <BR>.

Quick reference: http://www.php.net/nl2br
 
0
•••
Dynadot — .com TransferDynadot — .com Transfer
CatchedCatched

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back