I am trying to pass a Flash variable to a PHP page via the loadVars.sendAndLoad function. The variable name corresponds to a folder name that needs to be removed via the rmdir(); function. The Flash variable is passing fine, but will not delete the folder properly. Is it a string problem, or am I missing a step?
Here is the code used:
[blue]
FLASH CODE:
//----------------FLASH-----------------//
sender_btn.onPress = function() {
var getIT_lv:LoadVars = new LoadVars();
//below defines the variable to be passed to php from inpupt text field
getIT_lv.fname = _level0.input_txt.text;
getIT_lv.onLoad = function() {
//returned statement from PHP confirming deletion of folder
_level0.fromServer_txt.text = this.fromPHP;
};
getIT_lv.sendAndLoad("del_folder.php", getIT_lv,"POST");
};
//----------------------------------------//
PHP CODE:
//------------------PHP CODE---------------//
<?php
$fnew=$HTTP_POST_VARS["fname"];
rmdir($fnew);
$msg= $fnew . " has been deleted!";
$output="fromPHP=$msg";
echo $output;
?>
[/blue]
Any help would be greatly appreciated.
Thanks,
~Law Blank
Here is the code used:
[blue]
FLASH CODE:
//----------------FLASH-----------------//
sender_btn.onPress = function() {
var getIT_lv:LoadVars = new LoadVars();
//below defines the variable to be passed to php from inpupt text field
getIT_lv.fname = _level0.input_txt.text;
getIT_lv.onLoad = function() {
//returned statement from PHP confirming deletion of folder
_level0.fromServer_txt.text = this.fromPHP;
};
getIT_lv.sendAndLoad("del_folder.php", getIT_lv,"POST");
};
//----------------------------------------//
PHP CODE:
//------------------PHP CODE---------------//
<?php
$fnew=$HTTP_POST_VARS["fname"];
rmdir($fnew);
$msg= $fnew . " has been deleted!";
$output="fromPHP=$msg";
echo $output;
?>
[/blue]
Any help would be greatly appreciated.
Thanks,
~Law Blank