[PHP] Writing files a problem

2002-03-17 Thread Ben Waldher

When writing to a file several problems occur with this code:

?php
$stuff = include (news.txt);
$file = fopen (news.txt, w);
$newnews = include (template.txt) . $stuff;
fwrite ($file, $newnews);
?

However, this code works:

?php
$file = fopen(template.txt, w);
fwrite ($file, $temp);
fclose ($file);
?

The problem with the first set of code is that it opens template.txt1, and
some letters that were in template.txt become a 1.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] problem with file writing

2002-03-16 Thread Ben Waldher

I'm having some trouble writing data to a file, when I use this code it
works fine:
?php

$file = fopen(template.txt, w);

fwrite ($file, $temp);

fclose ($file);

?

But several problems with this occur:

?php

$stuff = include (news.txt);

$file = fopen (news.txt, w);

$newnews = include (template.txt) . $stuff;

fwrite ($file, $newnews);

?

First of all, it tries to open template.txt1 instead of template.txt.

Second of all, some letters written to news.txt become a 1 for some odd
reason. I don't know why.

I am using a windows server and I have tried using the mode wb but it
doesn't help.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php