RE: [PHP] magical file writing truncation

From: Date: Fri, 08 Aug 2003 11:49:40 +0000
Subject: RE: [PHP] magical file writing truncation
Groups: php.general 
Request: Send a blank email to php-general+get-158807@lists.php.net to get a copy of this message
[snip] > > [snip] > > $newFile = "xml/".$type."/".$now.".xml"; > > while(file_exists($newFile)) > > $newFile = "xml/".$type."/".$now++.".xml"; > > $text = $_POST['text']; > > $text = urlencode(stripslashes(nl2br($text))); > > [/snip] > > ack, sorry to double post... it appears that it actually reverse truncates the $text... so it cuts off the beginning of the text, and leaves the end bit. i can understand this happening as an XML interpreter as the <html> tags get in the way, but these are urlencoded, and writing to the file has nothing to do with the XML functions. [/snip] Let's work backwards then. Instead of $text = urlencode(stripslashes(nl2br($text))); try $text = urlencode(nl2br($text)); echo "$text"; Can you post the first couple of raw lines of text and then the echo'd output?

« previous php.general (#158807) next »