Re: Formatting Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 6:08 PM +0100 10/2/06, Toby Osbourn wrote:
Sorry to plague you with a question that should have a simple answer, but I
can't find said answer anywhere (probably looking for the wrong things in
the wrong places!)

Basically I want to allow a user to input a string via a form into a
database, I have the code to do that and it works almost 100% - I have made
it so that any html tags are stripping off the string before saving it, but
I do want to allow some basic formatting - namely when a user takes a new
line in the textbox, I want the new line to carry over to the database.

At the moment the user could type in something like this...

wibble
wobble

But after it has been submitted and then retrieved from the database it will
return wibblewobble.

Any ideas?

Regards

Toby

Toby:

Ideas?

After stripping html,

$txt = str_replace("\n","<br/>",$txt);
$txt = str_replace("\r","<br/>",$txt);

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux