Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 06-26-2005, 09:59 PM   #1
spacerom
Registered User
 
Join Date: Jun 2005
Posts: 7
Default From Flash to PHP? Not working!

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
spacerom is offline   Reply With Quote
Old 06-27-2005, 03:03 AM   #2
beanSoldier
Registered User
 
Join Date: Jun 2005
Posts: 35
Default

it might be this DatabankLoad.php.

do you know that the script is running.

make sure that path is correct.
beanSoldier is offline   Reply With Quote
Old 06-27-2005, 01:04 PM   #3
spacerom
Registered User
 
Join Date: Jun 2005
Posts: 7
Default

The skript and the path on Databankload.php are correct! This is the php document in which the variables from flash must be loaded... I have allready try the php skript in my server and it's ok...The variables from flash can not be loaded i guess, **** can anyone say which is the way in PHP 5 to load variables with POST ?? Or has someone any opinion on that problematic?
spacerom is offline   Reply With Quote
Old 06-29-2005, 12:32 AM   #4
spacerom
Registered User
 
Join Date: Jun 2005
Posts: 7
Default

It can not believe it, i have just try it a normal html form and the php script works...can anyone suggest a way to load variables from flash to php??
thanks
spacerom is offline   Reply With Quote
Old 06-29-2005, 02:30 AM   #5
Flash Gordon
rather be programming
 
Flash Gordon's Avatar
 
Join Date: Feb 2005
Location: City of Angels
Posts: 10,140
Default

Are Personal_Nr; SummeRight; etc, variables? or names of text fields?
__________________
trace("Good bye Flash.") Log.i(TAG, "Hello Droid");
Flash Gordon is offline   Reply With Quote
Old 06-29-2005, 08:29 AM   #6
spacerom
Registered User
 
Join Date: Jun 2005
Posts: 7
Default

They are names of text fields.
Why? Is that important?
spacerom is offline   Reply With Quote
Old 06-29-2005, 02:54 PM   #7
Xman51
Freedom Fighter
 
Xman51's Avatar
 
Join Date: Apr 2005
Location: wwwroot
Posts: 93
Send a message via AIM to Xman51
Default

Try:

ActionScript Code:
container_send.Var1 = Personal_Nr.text;           container_send.Var2 = SummeRight.text;           container_send.Var3 = Name.text;           container_send.Var4 = Second Name.text;           container_send.Var5 = Points.text;
L8er,

Xman51
Xman51 is offline   Reply With Quote
Old 06-29-2005, 08:58 PM   #8
spacerom
Registered User
 
Join Date: Jun 2005
Posts: 7
Default

well yes l have try that....
sorry, on my previous message i ment not that these variables are instances of textfields, they are variables with reference in textfields (like normal variables)....

Though, with instances too (like the way you shown), its working not...
spacerom is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:08 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.