$fp=fopen("joe.html","w");
What is the purpose of the "w" after user.html?
write only.
http://www.php.net/manual/function.fopen.php