I badly need to create an .XML file inside my theme every time user comes to my site.
But I can't.
This code in header:
<?php $ourFileName = "testFile.txt";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
fclose($ourFileHandle); ?>
Just does nothing. It doesn't display "can't open file", but it doesn't create the file as well.
I'm testing it at my /localhost machine and this code works perfectly everywhere there (so file permissions are alright), but not in Wordpress.
Why is it happening? :(