Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/10/2010, 05:12
XeykoServers
 
Fecha de Ingreso: octubre-2010
Mensajes: 7
Antigüedad: 13 años, 6 meses
Puntos: 0
Enviar pedidos

Hola Foreros..
Os voy a pasar un codigo bastante interesante,lo he cogido de una web que tiene codigos,pero nose como hacer que me llegue a mi correo sin ser por mailto :S

Código:
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#FF0000" VLINK="#000080" ALINK="#000080">
<!-- Cut-N-Paste JavaScript from ISN Toolbox 
     Copyright 1996, Infohiway, Inc.  Restricted use is hereby
     granted (commercial and personal OK) so long as this code
     is not *directly* sold and the copyright notice is buried
     somewhere deep in your HTML document.  A link to our site
     http://www.infohiway.com is always appreciated of course,
     but is absolutely and positively not necessary. ;-)   -->
<!-- ADD ANY ADDITIONAL INFORMATION HERE THAT YOU WANT TO APPEAR
     ABOVE THE ORDER FORM -->
<!--  uncomment this section and comment the other <form> tag if you decide
      to use the "Mailto Form Replacement in Perl" script (which can be found
      at http://www.infohiway.com/javascript?mailto)

<FORM ACTION="mailto:[email protected]?subject=Order Form" METHOD="POST" ENCTYPE="text/plain" onSubmit="return validate_form()">

<INPUT TYPE="hidden" NAME="transfer" VALUE="">
<INPUT TYPE="hidden" name="recipient" value="">
<INPUT TYPE="hidden" name="sub" value="">

-->



<!-- *** just change email address (nothing else) in action=" "
     unless you are going to use the Mailto Form Replacement Script (see above) ** -->

<form name="form1"  method="post" action="mailto:[email protected]?subject=Order Form" enctype="text/plain" onSubmit="return validate_form()">


<script language="JavaScript">
// This Script And Over 400 Others Found At
//  Java City 2000 http://www.jc2k.com
<!--
function createArray(size) {
 for (var i=0; i < size; i++) {
  this[i] = null }
 return this
}

function Product(descrip, money) {
 this.description = descrip;
 this.price = money;
}

function Category(name) {
 this.title = name;
 this.product = new createArray(1);
 this.product[0] = new Product("Please Select a Product", 0.00);
}

var category = new createArray(1);

// STEP NUMBER ONE
// enter the color for rows of the table
// (either javascript name or hex code)
color1 = "tan";
color2 = "khaki";

// STEP NUMBER TWO:
// change the following declarations to fit your needs
//
// category[1] = new Category("Category Title Goes Here");
//  category[1].product[1] = new Product("Prod. 1 Name", price);
//  category[1].product[2] = new Product("Prod. 2 Name", price);
//  category[1].product[3] = new Product("Prod. 3 Name", price);
//
// category[2] = new Category("Category Title Goes Here");
//  category[2].product[1] = new Product("Prod. 1 Name", price);
//  category[2].product[2] = new Product("Prod. 2 Name", price);
//  category[2].product[3] = new Product("Prod. 3 Name", price);
//
// NOTE: You must define both the category array and the product array
// consecutively starting at 1. Again, the index of both arrays starts at 1

category[1] = new Category("Título categoría 1");
 category[1].product[1] = new Product("Nombre de producto 1", 25.50);
 category[1].product[2] = new Product("Nombre de producto 2", 30);

category[2] = new Category("Título categoría 2");
 category[2].product[1] = new Product("Nombre de producto 1", 15.50);
 category[2].product[2] = new Product("Nombre de producto 2", 39.95);

category[3] = new Category("Título categoría 3");
 category[3].product[1] = new Product("Nombre de producto 1", .99);
 category[3].product[2] = new Product("Nombre de producto 2", 5.23);

category[4] = new Category("Título categoría 4");
 category[4].product[1] = new Product("Nombre de producto 1", 12);
 category[4].product[2] = new Product("Nombre de producto 2", 13);

// ***** NO NEED TO CHANGE ANY CODE AFTER THIS COMMENT ***

function SetLengths() {
 var k=1;
 while(category[k] != null)
  k++
 category.length = k;
 for (i=1; i<category.length; i++) {
  var j=1;
  while (category[i].product[j] != null)
   j++;
  category[i].product.length = j;
 }
}

SetLengths();

function writeTableRow(i) {
 document.write('<tr bgcolor="' + ((i%2 == 0) ? color1 : color2) + '">');
 document.write('<td>' + category[i].title.toUpperCase() + ':<br>'
  + '<select size="1" name="menu' + i + '" onChange="update(' + i + ')">');
 len = category[i].product.length;
 for (j=0; j<len; j++) {
  if (j != 0)
   document.write('<option>' + category[i].product[j].description
    + ' - $' + fix(category[i].product[j].price) + '</option>');
  else
   document.write('<option selected value=" ">Por favor selecciona un producto</option>');
 }
 document.write('</select></td><td valign=bottom>'
  + '<input type="text" value="0.00" name="price' + i + '" '
  + 'size=12 maxlength=12 onFocus="document.form1.price' + i + '.blur()">'
  + '</td></tr>');
}

function writeTable() {
 document.write('<table cellspacing=5 cellpadding=10 border=0>');
 for (i=1; i<category.length; i++)
  writeTableRow(i);
 document.write('<tr bgcolor="' + ((category.length%2==0) ? color1 : color2)
  + '"><td align=right>Total acumulado: </td><td><input type="text" '
  + 'name="total" size=12 maxlength=12 value="0.00"></td></tr></table>');
}

function update(num) {
 eval('selected = document.form1.menu' + num + '.selectedIndex;');
 cost = fix(category[num].product[selected].price);
 eval('document.form1.price' + num + '.value = cost;');
 var grand_total = 0;
 for (i=1; i<category.length; i++)
  eval('grand_total += parseFloat(document.form1.price' + i + '.value);');
 document.form1.total.value = fix(grand_total);
}

function fix(num) {
 string = "" + num;
 if (string.indexOf('.') == -1)
  return string + '.00';
 seperation = string.length - string.indexOf('.');
 if (seperation > 3)
  return string.substring(0,string.length-seperation+3);
 else if (seperation == 2)
  return string + '0';
 return string;
}

function validate_form() {
 validity = true;
 if (document.form1.shopper_name.value == "") {
  alert('¡Debes entrar tu nombre!');
  validity = false;
 }
 if (document.form1.email.value == "") {
  if (confirm("¿Quieres introducir tu dirección de correo?"))
   valid = false;
  else
   document.form1.email.value = 'Sin dirección de correo';
 }
 if (document.form1.phone.value == "") {
  alert('¡Debes entrar tu número de teléfono!');
  validity = false;
 }
 if (document.form1.credit_card_number.value == "") {
  alert('¡Debes entrar el número de tarjeta de crédito!');
  validity = false;
 } else if (document.form1.expiration_date.value == "") {
  alert('¡Debes entrar la fecha de caducidad de la tarjeta!');
  validity = false;
 }
 if (document.form1.bill.value == "") {
  alert('¡Debes entrar una dirección de facturación!');
  validity = false;
 } else if (document.form1.mail.value == "") {
  if (!confirm("¿La dirección de correo es la misma que la de facturación?"))
   validity = false;
  else
   document.form1.mail.value = 'la misma que la de facturación';
 }
 if (validity)
  alert("¡Gracias por haber realizado un pedido!");
 return validity;
}

// -->
</script>

<p>

<b>
Venta de productos
</b><br><br>

<script language="JavaScript">
// This Script And Over 400 Others Found At
//  Java City 2000 http://www.jc2k.com
<!--
writeTable();   // writes all categories

document.write('<br><table cellspacing=0 cellpadding=5 '
 + 'bgcolor="' + color1 + '">');
// -->
</script>

<tr><td align=left>
Nombre: <input type="text" name="shopper_name" size=30><br>
Email: <input type="text" size=30 name="email"><br>
Código de área y número de teléfono: <input type="text" size="14" name="phone"><br>
Número de tarjeta de crédito: <input type="text" size="18" name="credit_card_number">
<br>
Caduca en: <input type="text" size="5" maxlength="5" name="expiration_date">
</td></tr>

<tr><td>
Enviar factura a::<br>
<textarea wrap=virtual rows=5 cols=30 name="bill"></textarea><br>
Pedido a:<br><textarea wrap=virtual rows=5 cols=30 name="mail"></textarea></td></tr></table><br>
<input type="submit" name="submit" value="Enviar pedido"><input type="reset" value="Comenzar de nuevo"><br>
</p>
</form><P>


</body>
No quiero usar el Mailto..porque no me gusta nada xDD aver si alguien me dice como hacerlo para mandarlo de otra forma.
Si la opcion el PHP,os digo que no sé manejarlo ^^

Muchas Gracias.