well, we're getting a little beyond my experience here, so I am shooting in the dark now.
check: http://www.php.net/manual/en/function.fopen.php
for more info on the function.
the permission problem is probably the entire problem. You need to enable yourself write permission in that directory. probably using the chmod command. In order to do this you need to telnet to the machine, then do
chmod 777 fileNameOrDirectoryName
I THINK*
on the other hand, this could blow up your server... ;-)
talk to your host admin and get more accurate info probably.
craig