Jump to content
xisto Community
Sign in to follow this  
Damen

Flash + PHP: How can I transfer vars?

Recommended Posts

I am making a little section for a friends website.

Here is what I have so far.

:SWF File here:

And I made it you match the layout of here site.

Here

As you can see I pretty much have the layout of it down. Some little bugs to be worked out with characters allowd in the text boxes and what not. But I have a good platform.

NOW for the fun part!

Getting vars from flash to send, via POST, to PHP. I have been trying to find a good tutorial on this online but I am not having such great outcomes!

So if anyone can help me here please go for it!

This is exactly what I am looking for.

A way to pass vars from a flash swf(embeded in a .php file) to the PHP via a sumbit button on the SWF, then have the variable saved into a corisponding section in a DB.

I don't need any help with getting it saved to a DB, if anyone can get me to a point where as I can echo the variable in the PHP file and it show the one from the SWF file I am good as gold.

SO PLEASE! If anyone knows any tid bits of information I would be honored!

THANKS

Share this post


Link to post
Share on other sites

I believe you use the loadVariablesNum function. I haven't done any Actionscript for a little while, so this may not work perfectly, but I believe you do something like this:

 

varFirst = "one";varSecond = "two";loadVariablesNum("page.php?varFirst="+varFirst+"&varSecond="+varSecond", 0, "POST");

Despite it using a URL that looks like it uses GET, it should still use POST to send the variables across to the PHP script. They can then be used in PHP as $_POST['varFirst'] and $_POST['varSecond'].
Edited by rvalkass (see edit history)

Share this post


Link to post
Share on other sites

I don't think it matters where you have the variables stored, as long as you pass them in the way I have shown to the PHP script. I am sure that setting the text boxes to store their content in the variables would work just fine, but I have no way to test it at the moment.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.