A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Passing weird variables to a URL using POST

  1. #1
    Junior Member
    Join Date
    Feb 2001
    Posts
    7

    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!

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    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...

  3. #3
    Junior Member
    Join Date
    Feb 2001
    Posts
    7
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center