Link to home
Start Free TrialLog in
Avatar of Spiderstave
Spiderstave

asked on

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:

index.php?product_id1&option[1]=TEST&option[2]=TEST

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

ASKER CERTIFIED SOLUTION
Avatar of Spiderstave
Spiderstave

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Spiderstave
Spiderstave

ASKER

Figured it out.