Sending POST with Flash

Nummi_G4

New Rhapsody User
Hi all,

I am making a Flash site (yeah I know, Flash, blah) for a clothing store. You can go to the site, select the color and size of a certain shirt in Flash, then hit the add to cart button. I need the Flash button to send data through the POST method to paypal (I have the field names that need to be sent).

I have been trying to get this working locally with a test PHP page that accepts POST variables. Here is part of the AcrionScript:

Code:
storeVars.send("test.php", "_blank", "POST");

I've Googled the hell out of this problem and the above is the best I can come up with (not sure if I'm even headed in the right direction).

Any help would be great. Thanks.
 
Code:
dataSender1 = new LoadVars();

send.onRelease = function () {
		dataSender1.var1 = var1.text;
		dataSender1.var2 = "value";
		dataSender1.send("test.php", "_blank" , "POST");
};
this should work, (with send being a movie clip or button) the php file would get var1 and var2.

but it's been a while since I've done anything in flash so it might not, try www.actionscript.org if it doesn't loads of good info on the forum.
 
MrFluffy, bless you. :)

Here is my final code for anyone that needs this function.

Code:
on (release) {	
	dataSender1 = new LoadVars();
	dataSender1.objectSize = "thisIsValueOne";
	dataSender1.send("test.php", "_blank" , "POST");
}
 
edit: you got it while I was posting

yeah, it should open it in a new window, although I think the code would need to be
Code:
dataSender1 = new LoadVars();

on (release) {
        dataSender1.objectSize = "thisIsValueOne";
        dataSender1.send("test.php", "_blank" , "POST");
}
 
Back
Top