Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending variable from Flash to PHP

Status
Not open for further replies.

jjfletch

Technical User
Sep 4, 2004
13
US
I should preface this by saying that I know practically *nothing* about Flash or ActionScript. :)

I'm placing a form input field into a Flash banner. I just need to know how to get the input from the banner into PHP for processing. I don't need to send anything back to Flash, I just need to get the information into php.

I'm using the components that come packaged with flash, namely, the textbox and the button.

The textbox instance name is 'email'
The button instance name is 'join'
The php file I want to post the information to is called 'j.php'

I tried to add the following to the first frame of the layer that the textbox appears in, but it didn't work at all. I press the button and nothing happens.

join.onRelease = function ()
{
var data_to_send:LoadVars = new LoadVars();
data_to_send.email = _root.email.text;
data_sto_send.sendAndLoad("j.php",data_to_send,"POST");
}

I also tried the variant:

join.onRelease = function ()
{
var data_to_send:LoadVars = new LoadVars();
data_to_send.email = _root.email.text;
data_sto_send.sendAndLoad("}

But that didn't work either.

I know that the PHP code works fine because, once upon a time, the input text box was just good, old-fashioned html... Can someone help me out here?
 
You have typos in your code:
Code:
[b]data_sto_send[/b].sendAndLoad("j.php",data_to_send,"POST");
and
Code:
[b]data_sto_send[/b].sendAndLoad("[URL unfurl="true"]http://www.myservernamehere.com/j.php",data_to_send,"POST");[/URL]

frozenpeas
--
Micfo.com Affiliate Program
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top