Hi all,
I’m at a loss

I have looked in the forums for a couple of hours and spent more time on the web, but unfortunately haven’t seen anything that helps. My apologies in advance if the solution exists or just simply if this is a silly question.
Basically, I want to be able to open/create a file, write data to it, and close. I guess you might say I’m trying to write data to a file on a person’s pc. In testing methods to do this, I came up with the snippet:
<?php
// Get the data
include 'assets/templates/write/variables.php';
// Print the data on the screen
print $name . " is my name and I am " . $age . " years old.";
// Set the file
$SaveLoc = 'C:/Program Files/World of Warcraft/Interface/AddOns/test/DKPInfo.txt';
// Open or create the file
$handle = fopen($SaveLoc, 'w');
// Write to the data to the file
fwrite($handle, $name);
// Close the file
fclose($handle);
?>
The print $name… was simply to test that the snippet was using the variables I created and functioning on the document I created called “writetest”. When I view the page, I get the following:
Loretta is my name and I am 27 years old.
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
PHP error debug
Error: fopen(C:/Program Files/World of Warcraft/Interface/AddOns/test/DKPInfo.txt) [function.fopen]: failed to open stream: No such file or directory
While it is printing the variables, it of course does not create the file at the destination. I eventually want the code to function with an import/export form.
Thanks in advance for any guidance.