some one game me this code, to make it work w/ flash and php. right now, when i enter the text, and hit submit, its supposed to save it (on the server) as 'data.txt' - after i submit the text, i get the message "$msg" where is should say "it didnt work" or "worked succesfully"
here is the code
<?php
if (!$fp = fopen('data.txt', 'w')) {
$error = urlencode("it didnt work");
die("&result=$error&");
}
fwrite($fp,$HTTP_POST_VARS['myVar']);
fclose($fp);
$msg = urlencode("File updateded successfully");
echo "&result=$msg&";
?>
if there is nothign wrong with this - please tell me, and i will try and get help with the flash part, but i believe this is the problem - it returns "$msg" instead of what words it is.
and even though i believe im getting the seccessful message, nothing it writen to data.txt
Thanks for any help.
Steve