Jump to content

Recommended Posts

 

hey guys i have a little issue.

 

I'm working on a site where a person can put some information in about themselves

 

what happens is that once you wrote a nice long block of info and spaced it and so on you click save and it updates to my database.

 

but once you call it back in the website i just get 1 huge chuck of text and you lost all your spacings and formatting you did while writing the info.

 

can anybody please shed some light on how i can over come this?

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/159787-solved-php-styling/
Share on other sites

it depends on how you store and retrieve the data.  do you sanitize it in any way to remove formatting ?

 

Assuming this is done in a text area, you can use functions such as nl2br($text) to convert all of the newlines to the html equivolent <BR> for display purposes

Link to comment
https://forums.phpfreaks.com/topic/159787-solved-php-styling/#findComment-842765
Share on other sites

it depends on how you store and retrieve the data.  do you sanitize it in any way to remove formatting ?

 

Assuming this is done in a text area, you can use functions such as nl2br($text) to convert all of the newlines to the html equivolent <BR> for display purposes

 

Thanks! just what i needed :)

Link to comment
https://forums.phpfreaks.com/topic/159787-solved-php-styling/#findComment-842776
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.