Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Problem with a form..

SpaceshipSpaceship
SpaceshipSpaceship
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
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
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back