Re: [PHP] magical file writing truncation

2003-08-14 Thread skate
> > [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 actua

Re: [PHP] magical file writing truncation

2003-08-14 Thread skate
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? -- okay, the first few lines of raw text are as follows... it's a c

[PHP] magical file writing truncation

2003-08-14 Thread skate
so i'm writing to a file, but it's truncating part of the content, but not as i'd expect... see the code below, it writes to the file fine, and everything should be there, no errors. the problem occurs when it gets to writing . for some reason, it's truncating the content. but i'm not sure why

RE: [PHP] magical file writing truncation

2003-08-14 Thread Jay Blanchard
[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

Re: [PHP] magical file writing truncation

2003-08-14 Thread skate
[snip] i really can't get my head around this one at all. could it possibly be a windows issue??? i know windows can be an arse in dealing with files, but i can't see how it could pick up on a variable inside PHP and truncate it? [/snip] I just have one more thought because you brought up Window

RE: [PHP] magical file writing truncation

2003-08-14 Thread Jay Blanchard
[snip] $newFile = "xml/".$type."/".$now.".xml"; while(file_exists($newFile)) $newFile = "xml/".$type."/".$now++.".xml"; $text = $_POST['text']; $text = urlencode(stripslashes(nl2br($text))); [/snip] At this point (for testing putposes) I would echo "$text"; and start looking for clues.

Re: [PHP] magical file writing truncation

2003-08-14 Thread skate
I didn't see anything right off of the bat. You may want to output the text both ways and then compare them using http://us3.php.net/manual/en/function.strcmp.php apart from the fact that the slashes are there in one, and not in the other, there is no difference... $fp = fopen($n

RE: [PHP] magical file writing truncation

2003-08-11 Thread Jay Blanchard
[snip] OK, put stripslashes back in and show the echo'd out put again. - $text = urlencode(stripslashes(nl2br($text))); print $text; [/snip] I didn't see anything right off of the bat. You may want to output the text both ways and then compare them using http://us3.php.net/manua

Re: [PHP] magical file writing truncation

2003-08-10 Thread skate
[snip] Session+Start+%28Yahoo%21+-+fatcubanskate%3Athe_lady_in_waiting1982%29%3 A+Th u+Jul+10+21%3A23%3A42+2003+%3Cbr+%2F%3E%0D%0A%5B21%3A23%5D+the_lady_in_w aiti ng1982%3A+hey+sexy%21%21%21+%3Cbr+%2F%3E%0D%0A%5B21%3A24%5D+fatcubanskat e%3A +hey+sugar+%3Cbr+%2F%3E%0D%0A%5B21%3A24%5D+fatcubanskate%3

RE: [PHP] magical file writing truncation

2003-08-09 Thread Jay Blanchard
[snip] okay, the first few lines of raw text are as follows... it's a chat log btw... Session Start (Yahoo! - fatcubanskate:the_lady_in_waiting1982): Thu Jul 10 21:23:42 2003 [21:23] the_lady_in_waiting1982: hey sexy!!! [21:24] fatcubanskate: hey sugar [21:24] fatcubanskate: how\'s thing? [21:25]

RE: [PHP] magical file writing truncation

2003-08-09 Thread Jay Blanchard
[snip] i really can't get my head around this one at all. could it possibly be a windows issue??? i know windows can be an arse in dealing with files, but i can't see how it could pick up on a variable inside PHP and truncate it? [/snip] I just have one more thought because you brought up Windows.

Re: [PHP] magical file writing truncation

2003-08-09 Thread skate
> > obviously there's no simple solution here... can anyone point me in the way > of an alternative way of doing this? i could try the file write in 3 stages, > first part of content, text, end of content, as they seem to write fine > seperatly. > this is magical, evening seperating the file open

Re: [PHP] magical file writing truncation

2003-08-08 Thread skate
> [snip] > $newFile = "xml/".$type."/".$now.".xml"; > while(file_exists($newFile)) >$newFile = "xml/".$type."/".$now++.".xml"; > $text = $_POST['text']; > $text = urlencode(stripslashes(nl2br($text))); > [/snip] > > At this point (for testing putposes) I would echo "$text"; and start >