Can somebody tell me why this isn't working? I'm trying to get it to create a file in the plugins directory. After I get this working, I'll be trying to get this to create a file in the active theme's directory. Can somebody help me out here?
EDIT
I've changed my code, right now it creates the file but it does not input the text 'Testing' into the file even. Is there something I'm missing here?
$filename = __FILE__;
register_activation_hook($filename, 'superActivation');
register_deactivation_hook($filename, 'superDeactivation');
global $myFile, $fh, $stringData, $filename, $pluginbase, $full_plugindir;
$myFile = "../wp-content/themes/striking/testFile.php";
$stringData = "Testing\n";
$fh = fopen($myFile, 'w') or die("can't open file");
function superActivation() {
global $myFile; global $fh; global $stringData; global $filename;
fwrite($fh, 'test');
fclose($fh);
}
function superDeactivation() {
global $myFile;
if(is_file("$myFile")) {
unlink("$myFile");
}
}