 
			
				26/08/2011, 12:45
			
			
			     |  
      |    |    |    Fecha de Ingreso: agosto-2011  
						Mensajes: 27
					  Antigüedad: 14 años, 2 meses Puntos: 0     |        |  
        Como mandar una funcion Javascript a PHP        Hola, como puedo  mandar una funcion javascript a un archivo PHP para luego enviarlo por correo les dejo algo de codigo...   
Mi funcion JS 
function visualizarcarrito() { 
   numerodeorden = 0; 
   subtotal=0; 
   preciototal=0; 
   numerodeorden = getcookie("numerodeorden"); 
   tablas = ""; 
   for (i = 1; i <= numerodeorden; i++) { 
    nuevopedido = "Order." + i; 
    datos = ""; 
    datos = getcookie(nuevopedido); 
    ficha0 = datos.indexOf("|", 0); 
    ficha1 = datos.indexOf("|", ficha0+1); 
    ficha2 = datos.indexOf("|", ficha1+1); 
    campos = new Array; 
    campos[0] = datos.substring( 0, ficha0 ); 
    campos[1] = datos.substring( ficha0+1, ficha1 ); 
    campos[2] = datos.substring( ficha1+1, ficha2 ); 
    campos[3] = datos.substring( ficha2+1, datos.length ); 
    subtotal = subtotal + (campos[1] * campos[0]); 
    preciototal = formatoeuros(subtotal); 
    tablas += "<tr style='font: 9pt; text-align: justify; color=white'><td>" + campos[2] + "</td><td  style='color=navy'>" 
        + campos[3] + "</td>" 
        + "<td><input type=button id=boton value=\"  Eliminar  \" onClick=\"quitardelcarrito("+i+")\">" 
      	+ " <input type=button id=boton value=\"  Catálogo  \" onClick=\"parent.history.back()\"></td>" 
        + "<input type=hidden name=\"Referencia"+ i +"\" value=\"" + campos[2] + "\">" 
        + "<input type=hidden name=\"Producto"+ i +"\" value=\"" + campos[3] + "\">" 
        + "<input type=hidden name=\"Euros"+ i +"\" value=\"" + campos[1] + "\">"; 
        } 
   document.write(tablas); 
   document.write("</td></tr>"); 
  /* document.write(preciototal);*/ 
   document.write(""); 
}   
Mi formulario 
<?php 
   if ($_SERVER['REQUEST_METHOD'] != 'POST'){ 
      $self = $_SERVER['PHP_SELF']; 
?>   
    <!-- Start HTML form -->   
   	<form name="form" method="post" id="third" action="<?php echo $self;?>"  class="niceform"> 
    <table align="center"> 
    <tr><td> 
		<h1>.:PEDIDOS:.</h1> 
        <!-- Name -->   
		<label for="name"><strong><span class="blue">*</span> Nombre : </strong></label> 
			<input id="name" name="name" type="text" class="validate['required','length[3,-1]','nodigit']" size="20" />   
		<!-- Email --> 
		<label for="email"><strong><span class="blue">*</span> Email : </strong></label> 
			<input id="email" name="email" type="text" class="validate['required','length[5,-1]','email']" size="20" />   
		<!-- Website --> 
		<label for="ciudad"><strong><span class="blue">*</span>Ciudad :  </strong></label> 
			<input id="ciudad" name="ciudad" type="text" class="validate['ciudad']" size="20" />   
		<!-- Subject  
	    <label for="subject"><strong><span class="blue">*</span> Subject : </strong></label> 
			<input id="subject" name="subject" type="text" class="validate['required']" size="20" /> 
--> 
		<!-- Message --> 
		<label for="msg"><strong><span class="blue">*</span> Comentarios : </strong></label><br /> 
			<textarea id="message" name="message" type="text" class="validate['required']" rows="10" cols="30"></textarea>   
		<!-- Spam Check --> 
	    <label for="spamcheck"><span class="blue">*</span> <acronym  title="[ Spam prevention ]"><strong>Es usted Humano?</strong></acronym> : <span class="blue">2 + 3 = ???</span></label> 
			<input id="spamcheck" name="spamcheck" type="text" size="5" class="validate['required','number','spamcheck']" /> 
            <input id="carrito" name="carrito" type="hidden" value='<script language=JavaScript> 
visualizarcarrito(); 
</script>' />     
		<br /><br /> 
		<input type="submit" class="buttonSubmit" value="Enviar!" />     
	    <!-- Niceforms: mouse over effect --> 
		<!-- Do not remove the line below --> 
		<div id="stylesheetTest"></div>     
</td> 
<td>   
<div align="center" class="Estilo4">SUS PRODUCTOS</div>   
<table width="240" border="0" align="center" cellpadding="5" cellspacing="1"  style="font: 10pt Verdana, Geneva, Arial, Helvetica, sans-serif;"> 
<tbody> 
<tr style="font: bold"> 
<td width="50" > Código: </td> 
<td width="50" >Nombre:</td> 
<!--<td width="100" > Euros   </td> 
<td width="40" >Ud</td> 
<td width="160" >Control</td>--> 
</tr> 
<script language=JavaScript> 
visualizarcarrito(); 
</script> 
</tbody> 
</table>   
</td> 
</tr>   
</table> 
</form>     
<?php   
Saludos           |