-
Passing weird variables to a URL using POST
I have a question that is stumping me....
I am trying to POST variables to a website using getURL, which I don't have a problem with, the problem that I have is posting variables that look like this:
acct[first_name] = tafFirstName;
acct[last_name] = tafLastName;
acct[email] = tafEmail;
acct[dphone] = tafTelephone;
getURL("http://www.yoursite.com/order.php", "_blank", "POST");
Because the name of the variables has a bracket "[" they are not being viewed as variables. How can I make it so that the variables being passed through the POST feature look just like these with the brackets included?
I know I can do this with the GET function, but this form will not allow me to send the variables via GET.
Thank you for your help!
-
Registered User
hi,
I suppose acct is an object, and you're storing variables in the object's properties.
When using getURL(), I think that only the variables available on that timeline are sent.
So, a possible solution is creating variables in that timeline:
code:
for(prop in acct)
{
set(prop,acct[prop]);
}
which doesn't make sense because you've already got the variables tafFirstName, tafLastName, ...
i.e., you'd just be duplicating them....
If acct is a movie clip, you can do:
code:
acct.getURL(...);
If acct isn't an object, that's not valid syntax...
-
Thanks for the help, but it is not an object...it is just the name of the variable that I need in the form it is posting to. I did figure out the answer though if others are looking.
_root["acct[first_name]"] = tafFirstName;
_root["acct[last_name]"] = tafLastName;
_root["acct[email]"] = tafEmail;
_root["acct[dphone]"] = tafTelephone;
It works great now!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|