Groups | Blog | Home
all groups > flash data integration > march 2007 >

flash data integration : Sending a variable from Flash --> PHP


FlashGen
3/15/2007 12:00:00 AM
On 2007-03-15 03:54:54 +0000, "chopTheWood"
<webforumsuser@macromedia.com> said:

[quoted text, click to view]

Hey, chopTheWood,

If it is PHP 4 or 5 then the register_global flag will be set to false
in the PHP.ini file by default. What this means is that arbitrary
variable names will not be executed or processed.

If you are using POST as your example suggests try changing the PHP to:

<?php
$Name = $_POST['Name'];

echo "
&FromPHP=Hello $Name...&";
?>

That should fix it - Although as I don't have the entire script to hand
I cannot test it for you.

--
regs
m

------------------------------------
Mike Jones
FlashGen.Com
------------------------------------
w./ www.flashgen.com
e./ forum_postsATflashgenDOTcom
b./ blog.flashgen.com
------------------------------------
Arunkkumar2207j
3/15/2007 12:00:00 AM
try using

on (release) {
loadVariables("xxx.php", "POST");
}
chopTheWood
3/15/2007 2:30:19 AM
according to a Flash MX book I'm using, the following should work (their own
example):
The Flash movie:

- button with script:
on (release) {
loadVariablesNum("xxx.php", 0, "POST");
}
- input field set to variable "Name"
- dynamic text field with variable set to "FromPHP"

The PHP script for file "xxx.php":
<?php
echo "
&FromPHP=Hello $Name...&";
?>

Procedure: Input your name into the INPUT field, hit the button and ......
"Hello" appears in the dynamic text box (without the quotes),but no name
I'm new at PHP integration so it's probably a dumb mistake but I'm just
following the book..
thanks
tonyhigham
3/15/2007 2:55:33 AM
chopTheWood
3/15/2007 3:54:54 AM
MotionMaker
3/15/2007 5:35:48 PM
The problem with loadVariables is you do not have a feedback mechanism to know
if the PHP script succeeded. So it could be the PHP script.

Create an HTML document with a FORM and send the same variables to the PHP
script to be sure the script works.

Look at using http://livedocs.macromedia.com/flash/8/main/00002336.html
chopTheWood
3/15/2007 6:50:07 PM
Mike Jones:
FlashGen
3/16/2007 2:54:46 PM
On 2007-03-15 18:50:07 +0000, "chopTheWood"
<webforumsuser@macromedia.com> said:

[quoted text, click to view]

Always happy to help out :D

--
regs
m

------------------------------------
Mike Jones
FlashGen.Com
------------------------------------
w./ www.flashgen.com
e./ forum_postsATflashgenDOTcom
b./ blog.flashgen.com
------------------------------------
AddThis Social Bookmark Button