mi codigo es....
Código PHP:
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$para = "[email protected]";
$asunto = 'Contactos Basinger';
//*** Aca el cuerpo del Mensaje
$mensaje= "<html><head><title>Comentario de Contactenos</title></head><body><br><br>
<font size=5 font=arial>Este comentario ha sido enviado desde www.basinger.com.ve <br><br>Comentario enviado por: </font><br><br>";
$mensaje = $mensaje."<br><br>Nombre: ".$_POST['nombre'];
$mensaje = $mensaje."<br><br>Correo Electronico: <a href='mailto:".$_POST['correo']."'>". $_POST['correo'] ."</a>";
$mensaje = $mensaje."<br><br>Telefono: ".$_POST['telefono'];
$mensaje = $mensaje."<br><br>Direccion: ".$_POST['direccion'];
$mensaje = $mensaje."<br><br>Comentario: ".$_POST['comentario'];
$mensaje = $mensaje."<br><br></body></html>";
//***************************************************************
$cabeceras = 'From:'. $correo . "\r\n";
$cabeceras .= 'Reply-To: [email protected]' . "\r\n";
$cabeceras .= "Content-type: text/html; charset=iso-8859-1\n";
mail($para, $asunto, $mensaje, $cabeceras);
//***********************************************************************
$insertGoTo = "final.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>
<html>
<head>
<title>Carpas Anaconda ::.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><style type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--
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_validateForm() { //v4.0
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.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>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<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_validateForm() { //v4.0
if (document.getElementById){
var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(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>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="368" border="0" align="center" cellpadding="2" cellspacing="0" bordercolor="#000000">
<tr>
<td width="364" class="style8"><form action="contacto.php" method="post" name="form1" onSubmit="MM_validateForm('nombre','','R');return document.MM_returnValue">
<br>
<table width="321" align="center" bgcolor="#D6D5C7">
<tr valign="baseline">
<td width="97" align="right" nowrap class="verdana_once"> </td>
<td width="212" class="verdana_once"> </td>
</tr>
<tr valign="baseline">
<td align="right" valign="middle" nowrap class="verdana10">*Nombre:</td>
<td class="verdana_once"><input name="nombre" type="text" id="nombre" style="font-family: Verdana; color: #7a7864; font-size: 8pt; font-weight: regular; border: 1px solid #94906D" onBlur="MM_validateForm('nombre','','R');return document.MM_returnValue" value="" size="28"></td>
</tr>
<tr valign="baseline">
<td align="right" valign="middle" nowrap class="verdana10">*E-Mail:</td>
<td class="verdana_once"><input name="correo" type="text" style="font-family: Verdana; color: #7a7864; font-size: 8pt; font-weight: regular; border: 1px solid #94906D" onBlur="MM_validateForm('correo','','RisEmail');return document.MM_returnValue" value="" size="28"></td>
</tr>
<tr valign="baseline">
<td align="right" valign="middle" nowrap class="verdana10">Teléfono:</td>
<td class="verdana_once"><input type="text" name="telefono" value="" size="28" style="font-family: Verdana; color: #7a7864; font-size: 8pt; font-weight: regular; border: 1px solid #94906D"></td>
</tr>
<tr valign="baseline">
<td align="right" valign="middle" nowrap class="verdana10">Empresa: </td>
<td class="verdana_once"><input type="text" name="direccion" value="" size="28" style="font-family: Verdana; color: #7a7864; font-size: 8pt; font-weight: regular; border: 1px solid #94906D"></td>
</tr>
<tr valign="baseline">
<td align="right" valign="middle" nowrap class="verdana10">*Comentarios</td>
<td class="verdana_once"><textarea name="comentario" cols="29" rows="5" style="font-family: Verdana; color: #7a7864; font-size: 8pt; font-weight: regular; border: 1px solid #94906D"></textarea></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td class="verdana_once"><input type="submit" class="verdana11" style="font-family: Verdana; color: #7a7864; font-size: 8pt; font-weight: bold; border: 1px solid #7a7864" value="Enviar"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right"> </td>
<td class="verdana_once"> </td>
</tr>
</table>
<p class="texto-normal">
<input type="hidden" name="MM_insert" value="form1">
</p>
</form></td>
</tr>
</table>
</body>