Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Weird Troubles Writing to File
- Jolly Green Giant
May 5, 2006, 6:27 pm
rate this thread
it before. I don't know why it's not working now. It's not rocket
science. In general, I'd say I'm a PHP beginner, but with an
intermediate skill level in certain facets of the language.
$thisFileName = 'test.txt';
$fp = fopen($thisFileName, "w");
$write = fputs($fp, "test");
die("File does not exist.");
* This script is in the same directory as the text file.
* I am on a Windows server.
* The permissions for the folder I'm in, and the files, is 666
* I have tried using just the file name and also the full path.
I can modify that script to do a READ instead of a write, and set the
filename to a file that exists already.... it works just fine. But
even if I leave the filename to a file that exists, and try the above
script to write over it... it won't work.
How can I find out what the problem is? I'm not getting any PHP error
info on browser. I guess they have debugging turned off.
Thanks for any help!
Re: Weird Troubles Writing to File
Jolly Green Giant wrote:
Sorry, not sure what the problem is.
You should be able to turn error messages on with error_reporting(),
Another thing you could try is cut n paste the script in the php manual
for fwrite (its identical to fputs) as it checks for errors after each
step and it might tell you where the problem is.
- » Install issue: undefined symbol: php_escape_html_entities
- — Previous thread in » PHP Scripting Forum