This content has been marked as final. Show 3 replies
This appears to be working after a couple of tweaks. For anybody who is also having this problem, I removed the "POST" from the send function:
myObject = new LoadVars();
myObject.recipient = 1;
myObject.subject = "Testing of LoadVars";
myObject.name = "with LoadVars";
myObject.email = "email@example.com";
myObject.telephone = "+41 208 783 3984";
myObject.address = "24 King Drive";
myObject.send(" http://myHost.com/cgi-bin/FormMailer.pl" ,"_self");
It seems that you are mixing POST variables with GET variables in a wrong way1 person found this helpful
When you use your form you are sending the variables recipient and subject using both methods, GET and POST. Maybe this is why the script works because it depends on this fact (it is not the right thing to do though).
In your second example using LoadVars change the last line to:
myObject.send(" http://myhost.com/cgi-bin/FormMailer.pl?recipient=1&subject=NewTest", "_self", "POST");
This way you'll be doing the same as your form is doing.
If on the other hand it still doesn't work maybe it is due to security restrictions. If the host you are calling for example is myHost.com from flash the this is the same domain you need to use for the html page that contains the flash file. Otherwise flash will be blocked. Flash blocks itself from sending and reding data from internet if the file is in your local machine and viceversa. It blocks comunication too when the file is not in the same domain. Even if the domain is the same but you write it different. For example if you have your own server you can start you app using the domain localhost. But if flash is calling data using 127.0.0.1 then flash will block communication even though both ways of communication refer to the same server.