Van is right about the CHMOD thing, and about the functions. In brief....
To open a file we say:
$fp = fopen("filename.dat","w+");
ok so what is the w+? The w+ simply means we want to write and read to the file, so it will allow us to do so. There is also w, r, and another one I think but I am too lazy to check for it in the manual. Now what is this mysterious thing this function returns $fp. This is basically a pointer to the place on the disk where the file "lives", file descriptor. We need this when we use other function to tell PHP where our file is to write to. So... writing
$string = "I want this in a File";
fputs($fp,$string);
this says put the $string into the file descriptor we opened. And it does. 🙂
Anyway, just thought I would expound some more, I hope I didnt take any of the manuals thunder. 🙂
Hope this Helps!