Groups | Blog | Home
all groups > flash data integration > december 2004 >

flash data integration : PHP & Flash problems


jeitnier
12/24/2004 6:58:46 PM
Hi,

I'm having problems using flash to to send variables to my PHP script. This
is the code I'm using now.

Flash
--------

(Actions layer - Frame 1)
var test:String = new String();

Then, I have two buttons, "YES" and "NO". The "YES" button is intended to
store a value of "yes" into the test variable, and then sending the variable to
php by using this code.

(Main layer, Frame 1)
on (press) {
var q1 = "yes";
}
on (release) {
loadVariablesNum("answers.php", 0, "POST");
gotoAndPlay(5); //this frame just tells the user what the next instruction is.
}

the code for the "NO" button does the same thing, only replacing the "yes"
value with "no".

------------------------

Now, the php script is simply this.

<?php
echo "$test";
?>

------------------------

If anyone needs to see the actual files, just let me know. It seems as if my
variables aren't getting posted at all to the php file from flash. I'm sure
there is a simple solution, so could anyone please help me out? Thanks a bunch
in advance!

-Jared
Marian Heddesheimer
12/25/2004 9:05:30 AM
[quoted text, click to view]


try
echo $_POST['test'];

instead, this should work.
I suspect, your PHP has register_globals set to "off", so that you
have to use the superglobals $_POST or $_GET if you pass variables
from a HTML Form.

Regards

Marian

--
Tipps und Tricks zu PHP, Coaching und Projektbetreuung
AddThis Social Bookmark Button