Problem with a form..

SpaceshipSpaceship
Spacemail by SpaceshipSpacemail by Spaceship
Namecheap AuctionsNamecheap Auctions
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
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
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
Close
You should use PHP nl2br() function to convert new lines from textarea to <BR>.

Quick reference: http://www.php.net/nl2br
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

New: watch any domain
You can now watch domains on NamePros. We check each one and notify you when something changes. Search for a domain and press Watch on...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back