Ver Mensaje Individual
  #26 (permalink)  
Antiguo 12/01/2011, 13:46
moreweed
 
Fecha de Ingreso: enero-2011
Ubicación: Panamá
Mensajes: 18
Antigüedad: 13 años, 4 meses
Puntos: 0
Respuesta: Envio de formulario por php

si es la ultima linea...

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>LayaProductions</title>
<script type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_valida teForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
if (val) { nm=val.name; if ((val=val.value)!="") {
if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
} else if (test!='R') { num = parseFloat(val);
if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
min=test.substring(8,p); max=test.substring(p+1);
if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
} } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
} if (errors) alert('The following error(s) occurred:\n'+errors);
document.MM_returnValue = (errors == '');
}
//-->
</script>
<style type="text/css">
<!--
body {
margin-left: 5px;
margin-top: 0px;
margin-right: 5px;
margin-bottom: 0px;
}
.Estilo1 {color: #FFFF00}
#bienvenida {
margin: 20px;
padding: 10px;
}
.colorbienvenida {
font-family: "Times New Roman", Times, serif;
font-size: 24px;
font-weight: bolder;
color: #000000;
}
.contenido {
font-family: "Times New Roman", Times, serif;
font-size: 16px;
font-weight: bold;
color: #FF8700;
}
a:link {
color: #FFFF00;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #CCCCCC;
}
a:hover {
text-decoration: none;
color: #FFFFFF;
}
a:active {
text-decoration: none;
color: #FFFF00;
}
#formulario {
margin: 20px;
padding: 10px;
float: none;
}
.contacto {
font-family: "Times New Roman", Times, serif;
font-size: 24px;
font-weight: bold;
color: #000000;
text-decoration: underline;
}
-->
</style>
</head>

<body onLoad="MM_preloadImages('INICIO1.png','musica1.pn g','PROGRAMAS1.png','CONTATCOS1.png','REGISTRATE1. png')">
<table width="125" height="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<th height="75" colspan="4" bgcolor="#FF0000" scope="col"><div align="left"><img src="LayaProductions.png" alt="logo" width="1004" height="100"></div></th>
</tr>
<tr>
<td width="120" height="100%" valign="top" bgcolor="#FF0000"><table width="101%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th bgcolor="#FFFFFF" scope="col"><div align="left"><a href="index.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('inicio','','INICIO1.png ',1)"><img src="INICIO.png" alt="inicio" name="inicio" width="125" height="25" border="0"></a></div></th>
</tr>
<tr>
<td><a href="musica.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('musica','','musica1.png ',1)"><img src="MUSICA.png" alt="musica" name="musica" width="125" height="25" border="0"></a></td>
</tr>
<tr>
<td><a href="programas.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('programas','','PROGRAMA S1.png',1)"><img src="PROGRAMAS.png" alt="programas" name="programas" width="125" height="25" border="0"></a></td>
</tr>
<tr>
<td><a href="contactos.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('contactos','','CONTATCO S1.png',1)"><img src="CONTACTOS.png" alt="contactos" name="contactos" width="125" height="25" border="0"></a></td>
</tr>
<tr>
<td><a href="registrate.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('registrate','','REGISTR ATE1.png',1)"><img src="REGISTRATE.png" alt="registrate" name="registrate" width="125" height="25" border="0"></a></td>
</tr>
</table>
<p align="center">&nbsp;</p>
<p align="center"><img src="arroba.jpg" alt="arroba" width="120" height="120"></p>
<p align="center">&nbsp;</p></td>
<td width="11" valign="top" bgcolor="#FFFFFF"><!--DWLayoutEmptyCell-->&nbsp;</td>
<td width="863" valign="top" bgcolor="#EEEEEE"><div class="contacto" id="formulario">
<p>FORMULARIO DE CONSULTA </p>
<table width="100%" border="5" cellpadding="25" cellspacing="1" bordercolor="#996633">
<tr>
<th height="10" scope="col"><div align="left">

<form action="" method="post" name="Formulario" id="Formulario" onSubmit="MM_validateForm('nombre','','R','asunto' ,'','R','mail','','RisEmail','texto','','R');retur n document.MM_returnValue">
<fieldset>
<p><label>Nombre <input name="nombre" type="text" id="nombre" size="25" /></label></p>

<p><label>Asunto <input name="asunto" type="text" id="asunto" size="20" /></label></p>

<p><label>Correo Electronico <input name="correo" type="text" id="correo" size="40" /></label></p>

Texto
<p><label><textarea name="consulta" cols="50" rows id="consulta""6"></textarea>
</label></p>

<input name="enviar" type="submit" id="enviar" value="ENVIAR"/>
<input name="Restablecer" type="reset" value="LIMPIAR"/>
</fieldset>
</form>

</div></th>
</tr>
</table>
</div>
<p>&nbsp;</p></td>
<td width="4">&nbsp;</td>
</tr>

<tr>
<td height="25" colspan="3" bgcolor="#000000"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th width="30%" scope="col"><span class="Estilo1">WEBMASTER</span></th>
<th class="Estilo1" scope="col">LAYAPRODUCTIONS &copy;2010 PANAM&Aacute; </th>
<th width="30%" class="Estilo1" scope="col">[email protected]</th>
</tr>
</table></td>
<td bgcolor="#000000">&nbsp;</td>
</tr>
</table>

</body>
</html>

<?php
if($_POST){
$nombre = $_POST['nombre'];
$correo = $_POST['correo'];
$asunto = $_POST['asunto'];

$header = 'From: ' . $correo . " \r\n";
$header .= "X-Mailer: PHP/" . phpversion() . " \r\n";
$header .= "Mime-Version: 1.0 \r\n";
$header .= "Content-Type: text/plain";

$mensaje = "Este mensaje fue enviado por... " . $nombre . " \r\n";
$mensaje .= "Su e-mail es: " . $correo . " \r\n";
$mensaje .= "Mensaje: " . $_POST['consulta'] . " \r\n";
$mensaje .= "Fue enviado... " . date('d/m/Y', time());

$para = "[email protected]";
$asunto .= $asunto;

if(mail($para,$asunto,utf8_decode($mensaje),$heade r)){?>
<script>
window.location.href="correctamente.php";
</script>
<? }else{ ?>
<script>
window.location.href="error.php";
</script>
<? } }?>