Re: PHP inserting carriage returns into POST values?

From: Date: Fri, 04 Sep 2009 20:12:13 +0000
Subject: Re: PHP inserting carriage returns into POST values?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-297689@lists.php.net to get a copy of this message
Andrew Ballard wrote: > Javascript interpolates \n as a newline character inside both double > and single quotes unlike PHP that only interpolates inside double > quotes. If the client browser is running under Windows, it may even be > possible that the \n is recognized by the browser as a line terminator > and converted to the Windows line terminator sequence (\r\n) either > inside the form element itself or in the Javascript you are using to > post back to the web server. Both the server and the client are Linux machines, so there are no issues with incompatible representations of newline. I only ever place \n's inside double quotes in PHP, and am aware of the fact that I don't have to do that in PHP. For the life of me, I just can't figure out what's happening. Anyway, for now, filtering \r's out in PHP seems to do the trick. James

« previous php.general (#297689) next »