Re: Problems with user's newlines

From: Date: Mon, 10 Jul 2000 21:09:19 +0000
Subject: Re: Problems with user's newlines
Groups: php.general 
Request: Send a blank email to php-general+get-5812@lists.php.net to get a copy of this message
Most Windows clients (supposed Mac and Unix clients are different) send a \r allow with a \n to signify a new line. Obscure? Quite. So you need to delete all \r with ereg first, then run your second ereg() command. -- On Mon, 10 Jul 2000 16:30:42 kris wrote: >Hello, > > I am using Php3, JavaScript, and mysql on my site. I have a textbox >that users can fill in; this is stored in a database. Later, this >information will be redisplayed in a web page. The way the webpage is >generated is by using php to generate javascript which generates html. >It works fine unless the user puts in a newline. Then javascript >complains that the lines are not terminated. But I have been trying to >do ereg_replace on the strings: > >$string = ereg_replace("\n","<BR>",$string); > >I'm getting the <BR>'s, but still the newlines seem to be there. I >tried matching on "\\\n" and got the same result. Does anyone have any >ideas why this match is not working? >Thanks, >Kris L. > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net > > Send FREE Greetings for Father's Day--or any day! Click here: http://www.whowhere.lycos.com/redirects/fathers_day.rdct

« previous php.general (#5812) next »