Unstoppable Domains โ€” Get your daily AI drops report

Problem with a form..

NamecheapNamecheap
Namecheap AuctionsNamecheap Auctions
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.
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
•••
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
Appraise.net
Escrow.com
Spaceship
Domain Recover
CryptoExchange.com
Catchy
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back