Create a File using PHP/AS

[LEFT]Goal Button in Flash along with an input field passes the input field text to PHP and creates a new file on the server.

Problem
The problem right now is just with the PHP. It won’t create a new file when asked to pass variables. It will only work when hard coded. This means it works when I type: www.url.com/createfile.php and the php contains the file name hard coded (ie $file = “new.xml”). It won’t work if I remove the hard code and type www.url.com/createfile.php?file=new.xml.

Attempts
I’ve tried sever methods. Below is the code I’m using. As you can see I’m the methods I’ve tried are contained in there too, but marked out.


<?php
$_GET['File'];
//header("Content-Type: text/plain");
header("Content-Disposition: inline; filename=$file");
//$ourFileName = "testFile.xml";
//$file = $ourFileName;
$ourFileHandle = fopen($file, 'w') or die("can't open file");
//$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
fclose($ourFileHandle);
/*
$data = "This is a new file entry!
";   
if (!$file_handle = fopen($file,"w")) { echo "Cannot open file"; }  
if (!fwrite($file_handle, $data)) { echo "Cannot write to file"; }  
echo "You have successfully written data to $file";   
fclose($file_handle);  
*/
?>

In AS I’m just using the getURL method. However, the problem is with the php, because right now I’m ONLY testing in php not using Flash yet. Like I described above
[/LEFT]