Hi, I don’t think sending an Array via HTTPService like that is going to work.  We don’t serialize an array with objects like that into an HTTP POST automatically.  What if you built up an XML object instead and set the contentType to application/xml, then in your ASP you could parse that and interpret the same thing?

 

Matt

 


From: [email protected] [mailto:[email protected]] On Behalf Of Cesar Torrejon
Sent: Friday, July 21, 2006 3:45 AM
To: [email protected]
Subject: [flexcoders] Flex Store SendCart()

 

Hi I am try to implement function SendCart() for Flex Store Example.

I don´t know how I can send a email with the items selected when click on Submit Order

 

I am trying to send one Array with this information but my .ASP not work OK.

 

When the user click On Submit Order

 

[Bindable]
        private var misItems:Array = [];

 

private function Manda():void{
         var items:Array = productList.items;         
         for (var i:int=0; i < items.length; i++)
                    {
                     var product:Product = items[i].product;                     
                     misItems.push({Nombre:product.name, Precio:product.price, Cantidad:product.qty});                     

                    trace(misItems[i].Nombre + "-" + misItems[i].Precio + "-" + misItems[i].Cantidad);
                    }

    conexion.send(misItems);

   }

 

I configured my HTTPServices

<mx:HTTPService url="">http://localhost/email.asp" id="conexion" method="POST" resultFormat="text">

 

 

And then. my .ASP

<%

Set Mail = Server.CreateObject("Persits.MailSender")

Mail.Host = "smtp.xxx..com"

Mail.From = Request.Form("myemail")

Mail.FromName = "Pepe Lopez"

Mail.AddAddress [EMAIL PROTECTED], "Pepe Lopez"

Mail.Subject = Request.Form("asunto")

Mail.Body = Mail.Body & Request.Form.Count & VbCrLf    (If I select 2 phones for examples Request.Form.Count return "2")

    For index = 1 to Request.Form.Count

            Mail.Body = Mail.Body & Request.Form("misItems[index].Nombre" & index) & VbCrLf

            Mail.Body = Mail.Body & Request.Form("misItems[index].Precio" & index) & VbCrLf

            Mail.Body = Mail.Body & Request.Form("misItems[index].Cantidad" & index) & VbCrLf

    next

Mail.Send

%>

I dont know how to stract "misItems[index].Nombre" this value for example Nokia 3210

 

Please I need your help

 

Thaks To All.

Cesar

 

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to