[PHP] str_replace ? \r

2006-02-07 Thread Sam Smith
From a textarea on a web form I'm attempting to convert all returns(\r), from the users input, to br /, for db INSERT, and then back again for display in the textarea. (They remain as br /s for normal HTML web page display.) code: // From textarea to db UPDATE function addBR($tv) { $tv =

Re: [PHP] str_replace ? \r

2006-02-07 Thread Jay Paulson
http://us3.php.net/manual/en/function.nl2br.php Instead of using br / I would use p/p tags. That's just me though. :) On 2/7/06 12:38 PM, Sam Smith [EMAIL PROTECTED] wrote: From a textarea on a web form I'm attempting to convert all returns(\r), from the users input, to br /, for db

Re: [PHP] str_replace ? \r

2006-02-07 Thread Curt Zirzow
On Tue, Feb 07, 2006 at 10:38:37AM -0800, Sam Smith wrote: From a textarea on a web form I'm attempting to convert all returns(\r), from the users input, to br /, for db INSERT, and then back again for display in the textarea. (They remain as br /s for normal HTML web page display.) You

Re: [PHP] str_replace ? \r

2006-02-07 Thread Matty Sarro
Agreed - try to think of it as a filter and less of something that needs to be computed both ways... much easier in the long run, and more efficient :) On 2/7/06, Curt Zirzow [EMAIL PROTECTED] wrote: On Tue, Feb 07, 2006 at 10:38:37AM -0800, Sam Smith wrote: From a textarea on a web form

Re: [PHP] str_replace ? \r

2006-02-07 Thread Curt Zirzow
On Tue, Feb 07, 2006 at 03:43:38PM -0800, Curt Zirzow wrote: On Tue, Feb 07, 2006 at 10:38:37AM -0800, Sam Smith wrote: // output to html, removing xxs ablity and add html br's I mean XSS (Cross Site Scripting) Curt. -- cat .signature: No such file or directory -- PHP General Mailing List