Bill Abel escreveu:
Here is what I have now with only the .send method.

I tried using sendAndLoad(url, null, "POST")...as well as several different ways.

This is my currently working version. I've commented out the parts that I need to work. The function process the phone number and then puts everything into a LoadVars array to send. Right now it's sending it to a formmail.pl script which redirects you.

I need the LoadVars to be posted to the .aspx script. I don't need to receive anything back.


function processForm() {
    //process phone number
    var full_phone_number = phone_tb.text;
    split_number = full_phone_number.split("");
    for (var i = 0; i<split_number.length; i++) {
        if (split_number[i] == "\r" ||
            split_number[i] == "\n" ||
            split_number[i] == "\f" ||
            split_number[i] == "\t" ||
            split_number[i] == " " ||
            split_number[i] == "-" ||
            split_number[i] == "." ||
            split_number[i] == "(" ||
            split_number[i] == ")") {
            //trace("Found a: " + split_number[i]);
            split_number.splice(i, 1);
            i--;
        } else {
            if (split_number.length > 7) {
                //split into area code, prefix, and line number
            var areacodea = split_number.slice(0,3);
            var areacode = areacodea.join("");
            var prefixa = split_number.slice(3,6);
            var prefix = prefixa.join("");
            var linenumbera = split_number.slice(6,10);
            var linenumber = linenumbera.join("");
//trace("3 parts" + areacode + " " + prefix + " " + linenumber);
            } else {
                // split into prefix and line number
            var prefixa = split_number.slice(0,3);
            var prefix = prefixa.join("");
            var linenumbera = split_number.slice(3,7);
            var linenumber = linenumbera.join("");
            //trace("2 parts" + prefix + " " + linenumber);
            }
            //number = split_number.join("");
            //trace(number);
        }
    }
var getData:LoadVars = new LoadVars(); var formData:LoadVars = new LoadVars();
formData.firstname = firstname_tb.text;
formData.lastname = lastname_tb.text;
formData.address = address_tb.text;
formData.city = city_tb.text;
formData.state = state_tb.text;
formData.zip = zip_tb.text;
formData.phone = phone_tb.text;
formData.email = email_tb.text;
trace(formData);
formData.sendAndLoad("http://www.hallmanhill.com/cgi-sys/FormMail.pl";, getData, "POST");

getData.onLoad = function(ok:Boolean) {
   if(ok) {
   trace(this);
   trace("Data transfered!!!");
   }
}

//formData.send("http://www.hallmanhill.com/cgi-sys/FormMail.pl";, "_self", "POST"); //formData.sendAndLoad("https://www.salescloser.com/XMLAddContact.aspx";);
Just do an test!!!

--
Gustavo Teider ( gugateider )
www.gugateider.com
Curitiba - PR



  errorVars = new LoadVars();
    formData = new LoadVars();
    formData.firstname = firstname_tb.text;
    formData.lastname = lastname_tb.text;
    formData.address = address_tb.text;
    formData.city = city_tb.text;
    formData.state = state_tb.text;
    formData.zip = zip_tb.text;
    formData.phone = phone_tb.text;
    //formData.homephone1 = areacode;
    //formData.homephone2 = prefix;
    //formData.homephone3 = linenumber;
    formData.email = email_tb.text;
    //formData.Protocol = "Ing";
    trace(formData);
formData.send("http://www.hallmanhill.com/cgi-sys/FormMail.pl";, "_self", "POST"); //formData.sendAndLoad("https://www.salescloser.com/XMLAddContact.aspx";);
}




On Sep 20, 2006, at 2:57 PM, Gustavo Teider - Adobe Flash Developer wrote:

Bill Abel escreveu:
How do you post an array to a server side-script without loading the script's URL in the browser.

I can post data using Ruby's Net::HTTP and it works great in a rails app. I want to do the same thing in Flash.

LoadVars.send will only work if I load the script's URL into the browser. This would be fine if I controlled the script, but it's on another application server. I need to pass it the data in the background. I tried .sendAndLoad, but that has the same problems.

Is there a simple way to do this? Can I use flash remoting and pass the data to a PHP script and make the post from there? I see there is a way to do this with Cold Fusion using the CF.http() method, so I assume there is something similar elsewhere.

thanks.
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

always i used sendAndLoad method to do this ...

its works fine ...

what your code ?

did you create two loadVars ?

one to post , other to get ?

[]´s

--Gustavo Teider ( gugateider )
www.gugateider.com
Curitiba - PR

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to