Hello to all!
I have a problem with a transfer from variables from action script to php and then to a databank...
I used this code on a button in flash:
ActionScript Code:
on (release) {
if (!Personal_Nr.length) {
Kontakt_Status = "Bitte give your PnR!";
} else if (!Name.length) {
Kontakt_Status = "Please give your name!";
} else if (!Secondname.length) {
Kontakt_Status = "Please give you second name!";
} else {
container_send = new LoadVars();
container_send.Var1 = Personal_Nr;
container_send.Var2 = SummeRight;
container_send.Var3 = Name;
container_send.Var4 = Second Name;
container_send.Var5 = Points;
unescape(container_send);
container_send.sendAndLoad("DatabankLoad.php", container_send, "POST");
gotoAndStop("End");
}
}
It should be working but it does not....
In PHP however i use this script (I should i have PHP 5.0.2 in my Apache Server installed):
PHP Code:
$Var1 = $HTTP_POST_VARS['Var1'];
$Var2 = $HTTP_POST_VARS['Var2'];
$Var3 = $HTTP_POST_VARS['Var3'];
$Var4 = $HTTP_POST_VARS['Var4'];
$Var5 = $HTTP_POST_VARS['Var5'];
$conn_id = mysql_connect("localhost","root","");
$db_con = mysql_select_db("Netzwerk_Quiz",$conn_id);
IF($conn_id){echo "Connection ok!"."<BR><BR>";}
else
{ echo "No connection"."<BR><BR>";}
IF($db_con){echo "Databank is chosen"."<BR>";}
else {echo "Cant find databank"."<BR>";}
echo "<BR>";
echo "----------------------------------------------------------------------------------------";
echo "<BR><BR>";
$daten_hinlegen = "INSERT INTO Results_from_Quiz
VALUES('".$Var1."','".$Var2."','".$Var3."','".$Var4."','".$Var5."')";
$ergebnis = mysql_query($data_save);
IF($ergebnis){echo "New data saved in databank"."<BR><BR>";}
else
{ echo "Canot save data"."<BR><BR>";}
?>
It cannot working although the php and mysql are ok...The problem i can not laod the variables from Flash to the php document....
Can anyone help?
spacerom