Unstoppable Domains โ€” Expired Auctions

White spaces from form?

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch
Impact
4
I have one minor problem.
I have a textarea box where a user can put in information. I have that information put into mysql, and then read from mysql later on.
The problem I'm having is that when it is read there are no whitespaces, meaning that if the user put in text with an enter, it doesn't print the enter. For example, A user puts this in:
"This is my text
I have an enter

Now I put 2 enters!"

It prints "This is my text I have an enter Now I put 2 enters!"

Anyone got an idea how to fix this? Thanks
 
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
you need to run it thru nl2br() html ignores returns etc, when seomeone types in as your example:-

"This is my text
I have an enter

Now I put 2 enters!"

the form is actually sending:-

This is my text\nI have an enter\n\nNow I put 2 enters!

if you right click on the outputted page you will see that the returns are actually there its just the browser ignores them as returns are not in the html standard

http://uk.php.net/manual/en/function.nl2br.php
 
0
•••
CatchedCatched
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