
Mostrar_carro (es para ver lo que se ha seleccionado del carro, osea el carro mismo)
Formulario (es para obtener los datos de quien hace el pedido)
Guardar (quiero guardar lod datos del pedido aca en un TXT)
Enviar_mail (quiero mandar por mail el formulario y el carro)
Pero el tema es que no se



AYUDAAAAAAAAA!


Código:
<% @LANGUAGE="VBSCRIPT"%> <% Dim CONST_LIBRO, oFSO, f, archivo, accion, contenido CONST_LIBRO="001.txt" set oFSO=Server.CreateObject("Scripting.FileSystemObject") accion=Trim (CStr(Request.QueryString("a"))) select case accion case "guardar" muestra_carrito Guardar envio_mail case else muestra_carrito MostrarFormulario end select set oFSO=nothing sub muestra_carrito precio_total=0 if session("num_prod")=0 then response.write "el carrito está vacio" else for i=1 to session("num_prod") response.write "linea de producto " & i & "<br>" if session("producto" & i) <> 0 then response.write "Identificador de producto " & session("producto" & i) & "<br>" response.write "Nombre de producto " & session("nombre" & i) & "<br>" response.write "Precio de producto " & session("precio" & i) & "<br>" response.write "<a href=""borrar_producto.asp?linea=" & i & """>Borrar producto</a>" precio_total = precio_total + session("precio" & i) else response.write "Este producto ha sido borrado del carrito" end if response.write "<p>" next response.write "El precio total del producto es " & precio_total & "<p>" end if end sub 'muestra_carrito sub envio_mail Dim xname,x,zname,z,dmensaje,d,ip xname = "Nombre" x= Request.Form("nombre") zname = "E-mail" z= Request.Form("mail") dmensaje = "Mensaje" d= Request.Form("mensaje") ip=CStr(Request.servervariables("remote_host")) Dim ObjMail Set ObjMail = Server.CreateObject("CDONTS.NewMail") ObjMail.To = "[email protected]" ObjMail.From = "[email protected]" ObjMail.Subject = "Pedido" ObjMail.Body = xname & vbcrlf&_ x & vbcrlf&_ zname & vbcrlf&_ z & vbcrlf&_ dmensaje & vbcrlf&_ d & vbcrlf&_ ip ObjMail.Send Set ObjMail = Nothing Response.Redirect "http://www.miweb.com/carrok.htm" end sub 'envio_mail Sub Guardar Dim nombre, mail, mensaje, fecha, archivo, f fecha=Day(Now())&"/"&Month(Now())&"/"&Year(Now()) nombre=Trim(CStr(Request.Form("nombre"))) mail=CStr(Request.Form("mail")) mensaje=CStr(Request.Form("mensaje")) ip=CStr(Request.servervariables("remote_host")) if nombre <> "" and mensaje <>"" then set archivo=oFSO.GetFile( Server.MapPath(CONST_LIBRO) ) 'Abro el archivo como un flujo de texto; 8: ForAppending, añadimos al final set f=archivo.OpenAsTextStream(8) f.WriteLine("<hr noshade>") f.WriteLine("<b>"&nombre&" ("&mail&")</b> escribió el "&fecha&":<br>") f.WriteLine(mensaje) f.WriteLine("<br><br>") f.WriteLine("mensaje: "&ip&"") 'Cierro el fichero f.Close set f=nothing set archivo=nothing Response.Write("<small>Se ha añadido con éxito tu comentario</small>") end if End Sub 'Guardar Sub MostrarFormulario %> <br><br><br><hr size=2> <TABLE BORDER="0" ALIGN="center"> <FORM NAME="form1" METHOD="post" ACTION="enviar.asp?a=guardar"> <TR> <TD>Tu nombre:</TD> <TD><INPUT TYPE="text" style="width: 170px; height: 18px; font-family: Arial, Verdana; font-size: 8pt; font-weight: bold; border: 1px solid rgb(153,255,255)" NAME="nombre"></TD> <TR> <TD>E-mail:</TD> <TD><INPUT TYPE="text" style="width: 170px; height: 18px; font-family: Arial, Verdana; font-size: 8pt; font-weight: bold; border: 1px solid rgb(153,255,255)" NAME="mail"></TD> <TR> <TD>Mensaje:</TD> <TD><textarea ROWS="5" COLS="30" style="width: 270px; height: 100px font-family: Arial, Verdana; font-size: 8pt; font-weight: bold; border: 1px solid rgb(153,255,255)" NAME="mensaje"></textarea></TD> <TR> <TD COLSPAN="2"> <center><INPUT TYPE="submit" VALUE="Escribir"><INPUT TYPE="reset" VALUE="Limpiar"> </TD> </TABLE> </FORM> <% End Sub 'MostrarFormulario %>