Usage of fopen/fwrite/fclose in WordPress theme
-
Hi everybody,
I’m trying to create a file by using the following code in my sidebar.php:
$file = fopen("file.xml", "w"); fwrite($file, $xml); fclose($file);
I tested the script outside WordPress and it works fine, however, when using it within WP I get an error message saying
Warning: fopen(file.xml) [function.fopen]: failed to open stream: Permission denied in sidebar.php on line 46
Warning: fwrite(): supplied argument is not a valid stream resource in sidebar.php on line 47
Warning: fclose(): supplied argument is not a valid stream resource in sidebar.php on line 48
Any idea what’s wrong? the file exists already and has CHMOD 777 and as I stated before the script works fine when used stand alone.
Cheers
Felix
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Usage of fopen/fwrite/fclose in WordPress theme’ is closed to new replies.