error_reporting(0);
$classError = "error";
$classTxt = "text";
$classField = "field";
$classInputbutton = "inputButton";
$classInputline = "inputLine";
$classInputfield = "inputField";
$styleInputline = "width:300px;";
$styleInputfield = "width:300px; height:60px;";
$styleInputbutton = "width:300px;";
$styleInputradio = "vertical-align:middle;";
$styleInputselect = "width:300px;";
// email
$targetAddress = "mimanga1@gmail.com";
$emailSubject = "CONSULTA EN Efectosjavascript.com";
// misc text
$txtSend = "Enviar";
$txtMandatory = "Obligatorio";
$msgDate = "Date";
$dateFormat = "d. M Y, H:i";
$txtRemainingChars = "Te quedan estos caracteres:";
// indent for field values in email message
$msgIndent = 15;
// errors (above/below the field)
$posError = "above";
//thank you messages
$txtThankyou = "
¡Gracias por contactar con Efectos Javascript!
Tu consulta nos ha sido recibida y nos pondremos en contacto contigo lo antes posible.";
$fields[] = array("Nombre:", "name", "line", "", "*", "Introduce tu nombre");
$fields[] = array("Website:", "website", "line", "", "*", "Introduce el nombre de tu sitio Web");
$fields[] = array("Ciudad:", "city", "line", "", "", "");
$fields[] = array("Telefono:", "phone", "line", "", "", "Introduce un número de teléfono");
$fields[] = array("Email:", "email", "line", "email", "*", "Introduce un e-mail válido");
$fields[] = array("
", "", "divider", "", "", "");
$fields[] = array("¿Qué necesitas?:", "interests_2", "multiselect", "{Anunciarse}{Hacemos tu site?}{Posicionamos tu site?}{Intercambio de links}{Sugerencia}{Pregunta}", "*", "Elige un servicio");
$fields[] = array("
", "", "divider", "", "", "");
$fields[] = array("Consulta:", "limited", "field", 250, "*", "Introduce tu consulta");
$version = "1.5";
$errorPointer = ($posError == "above") ? "↓ " : "↑ ";
function spaces($num, $fill=" "){
$foo="";
for ($i=0; $i<$num; $i++) $foo.=$fill;
return $foo;
}
function isValidEmail($addr){
if(eregi("^[a-z0-9]+([_.-][a-z0-9]+)*@([a-z0-9]+([.-][a-z0-9]+)*)+\\.[a-z]{2,4}$", $addr))
return true;
else
return false;
}
function jsCharCount(){
if ($GLOBALS['cfCharCountFunc'] != 1){
$html = "\n";
$GLOBALS['cfCharCountFunc'] = 1;
return $html;
}
}
// start form evaluation
unset($error);
if ($_REQUEST['do']=="send"){
$error = false;
$fromAddress = "";
$message = "";
foreach ($fields as $field){
if ($field[4] == "*"){
if ($field[3] == "email"){
if (!isValidEmail($_REQUEST[$field[1]])) $error[$field[1]] = $field[5];
}else{
if ($_REQUEST[$field[1]] == "" || $_REQUEST[$field[1]] == " " || $_REQUEST[$field[1]] == " ") $error[$field[1]] = $field[5];
}
}
}
if ($error === false){
$message = $emailSubject." \n";
for ($i = 0; $i < strlen($emailSubject); $i++) $message .= "*";
$message .= " \n\n$msgDate:".spaces($msgIndent-strlen($msgDate)).date($dateFormat);
foreach ($fields as $field){
if ($field[2] == "divider"){
$message .= "\n-----------------------------------";
}else{
$message .= "\n".$field[0].":".spaces($msgIndent-strlen($field[0]));
if ($field[3] == "email"){
$message .= "mailto:".$_REQUEST[$field[1]];
$fromAddress = "From: ".$_REQUEST[$field[1]];
}else if ($field[2] == "checkbox" || $field[2] == "multiselect"){
$multi = "";
foreach ($_REQUEST[$field[1]] as $val){
$divider = ($multi != "") ? ", " : "";
$multi .= (isset($val) && $val != "") ? $divider.$val : "";
}
$message .= $multi;
}else $message .= $_REQUEST[$field[1]];
}
$message .= " ";
}
mail($targetAddress, $emailSubject, $message, $fromAddress);
//echo "
$message
";
echo $txtThankyou;
}
}
if ($error!==false){
$html = "";
// draw form
$html .= "\n\n \n\n";
$html .= "
\n";
$html .= "\n \n\n";
echo $html;
}
?>
Efectosjavascript © 2005-2009