AS2 - Padding array values to PHP

Posted on 2011-10-28
Last Modified: 2012-06-21
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

Question by:Spiderstave

    Accepted Solution

    Figured it out:

    myVars["option[2]"] = _root.ConfigString();
    myVars["option[1]"] = _root.ProductName();

    Author Closing Comment

    Figured it out.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
    Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
    The viewer will learn how to dynamically set the form action using jQuery.
    The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now