Reply to Weird Troubles Writing to File

Your name:

Reply:


Posted by Jolly Green Giant on 05/05/06 21:27

I'm trying to use PHP to create a text file. Simple right? I've done
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");
fclose($fp);
if (!file_exists($thisFileName))
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
(read/write).
* 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!

--
JGG

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация