Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: Keeping the format of text in a field when inserting into a database.


Message #1 by Empier4552@a... on Thu, 1 Aug 2002 17:59:37
The formatting of the text shouldn't change at all. It might be that you're
just displaying the inserted text in the browser directly from the database.
HTML doesn't parse consecutive whitespace characters between tokens
literally.  You'd need a <pre> tag or some other formatting changes for that
kind of effect in the browser.


For instance, if a user entered
<textarea>
Hello, world!

  how are you today?



     I'm peachy.

</textarea>

That text would be inserted into the database, newlines, spaces, and all.
If you were to display that text in the browser, though, it'd look like
this:

Hello, world! how are you today? I'm peachy.


Is that the problem?

nik


  Return to Index