You are here: Re: [PHP] control-M « PHP « IT news, forums, messages
Re: [PHP] control-M

Posted by David Christensen on 05/05/05 19:30

I am? That news to me??? I just did a 'grep nl2br form.php' and I
don't any output with nl2br. I'm not sure this is what's going on.

I did see that function in the "Strings" section of the manual, but it
didn't do anything for me.

Thanks for your help,

Dave


On Thu, 2005-05-05 at 16:11 +0200, Marek Kilimajer wrote:
> David Christensen wrote:
> > Actually, I forgot to also mention that the browser is changing the
> > control-M (^M) from the query when it sets the default value for the
> > textarea to "<br />". I guess that is the HTML representation of the
> > ^M.
>
> you are using nl2br() on the input, that funcion adds '<br />' before
> all newline characters.
>
> >
> > I'm currently using:
> >
> > $_POST[$field] = str_replace("\r\n", "\n", $_POST[$field]);
> > $_POST[$field] = strip_tags($_POST[$field], '<br />');
> >
> > in a foreach loop for all the $_POST vars, but it's still not removing
> > it.
> >
> > Dave
> >
> > On Thu, 2005-05-05 at 10:12 +0200, Marek Kilimajer wrote:
> >
> >>David Christensen wrote:
> >>
> >>>I know I'm missing something, but I can't seem to find it or figure it
> >>>out. I've done the google search, and I've done a quick scan of the
> >>>list archives, but I can't seem to find the right way to remove
> >>>control-M from a form submission page with textarea fields.
> >>>
> >>>I have a series of "textarea" fields that can/and do contain the dreaded
> >>>^M characters. For the life of me, I can't figure out how to remove
> >>>them before I save them to the database, and how to remove the ones that
> >>>are all ready stored there when I query them back to the browser from a
> >>>web page. Also, if I do remove them, how do I make sure I format the
> >>>text correctly when I push it back to the browser as the default values
> >>>of these fields?
> >>>
> >>>Point me to the elixir of knowledge and let me bath in the fortitude of
> >>>a master regex expression to rid me once and for all of the dreaded
> >>>^M!!!
> >>>
> >>>Thank you, and good night!
> >>
> >>... = str_replace("\r\n", "\n", ...);
> >>
> >>But I don't see how this would infuence the default values of form
> >>inputs, plain htmlspecialchars() should be enough.
> >>
> >
> >
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация