Hi guys i guess this is quite a simle process but i have no clue how i pull it off what i how can i use a text area which will show all formatted text so if a user presses enter to add a new line or start a new paragraph example shown below

i went to the shop and bought (pressed enter)
500 cakes.

where when a user enters and submits to my db and i retrieve the text it loses all user formatting and will appear like this

i went to the shop and bought 500 cakes.

Is there a way for me to be able to somehow scriptthe text area to keep all user formatting ???

I,m not asking someone to write the script for me but at least point me in the right direction please.

Many Thanks Pinky.

    When the string gets passed from the form to your PHP page, it does include line feed characters. When you redisplay that text on screen, web browsers ignore those line feed characters which is why it shows up on one line.

    You need to replace the line feed characters with <br> tags so that when it's sent out to a browser, the browser will display it as you desire.

      Thanks for you prompt reply i jus found on another post the nl2br php function which seemed to have worked like a charm but thank you for the fast response 🙂

        Write a Reply...