PDA

View Full Version : loadvariables working for input boxes but not for buttons?


rikioooh
10-27-2008, 09:25 PM
ok so ive been successful posting variables to a php file from input boxes but for some reason i cant send static variables to php or im doing it wrong.


basically what i want to do is say

on(release){
var = "something";
loadVariables("test.php", "POST");
}


so the variable thats sent is "something".


heres what i have


actionscript on my button:

on(Press){
compare = "testing";
loadVariables("test.php", "POST");
}



php that its posting to:



<?

$input = $_POST['compare'];
$data = strip_tags($input);
$var = "frm=" . $data;

$filename = "worked.txt";
$handle = fopen($filename,'w') or die("can't open file");
fwrite($handle, $var);
fclose($handle);

?>



guess im stumped :confused: