Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 279
  • Last Modified:

AS2 - Padding array values to PHP

Hi everyone,

I'm converting something from sending variables via GET to POST. Previously, using the URL string, I'd passed values like this:


That worked great, and I was able to insert directly into the PHP arrays.

But, now that I'm switching to sending via POST, I'm having a hard time. Using the code below I'm able to successfully send data to PHP via POST. However. if I change the option1 and option2 variables to:

myVars.option[1] = "TEST";
myVars.option[2] = "TEST";

It doesn't work. I'm starting to think it isn't possible. I suggested the PHP developer just receive option1 and option2 variables and insert them into the array before processing, but he says that would be a lot of work.

Any ideas? Anyone done this?
myVars = new LoadVars();
myVars.product_id = 49;
myVars.option1 = "TEST";
myVars.option2 = "TEST";
myVars.send("index.php", "_self", "POST");

Open in new window

  • 2
1 Solution
SpiderstaveAuthor Commented:
Figured it out:

myVars["option[2]"] = _root.ConfigString();
myVars["option[1]"] = _root.ProductName();
SpiderstaveAuthor Commented:
Figured it out.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now