Need help with fopen in php?

  • Thread starter Thread starter worknman73
  • Start date Start date
W

worknman73

Guest
I'm using the following code. It works if the file does not exist, but gives an error message of "Remote file already exists and overwrite context option not specified" if the file does already exist. How do I get this to overwrite an existing file. I tried r, r+, w, w+ options, and nothing works.

$fh = fopen("$filename", "w");
$errorcheck =(fwrite($fh, "stuff I want to write"));
fclose($fh);
 
Back
Top