Foros del Web » Administración de Sistemas » Software para Servers »

Formulario de contacto

Estas en el tema de Formulario de contacto en el foro de Software para Servers en Foros del Web. Para habilitr el Formulario de contacto hay que habilitar alguna funcion especial en el servidor?...
  #1 (permalink)  
Antiguo 08/01/2011, 08:13
Avatar de fernando2222  
Fecha de Ingreso: diciembre-2009
Mensajes: 110
Antigüedad: 14 años, 4 meses
Puntos: 1
Formulario de contacto

Para habilitr el Formulario de contacto hay que habilitar alguna funcion especial en el servidor?
__________________
www.mshunderwear.com.ar la marca del momento....
  #2 (permalink)  
Antiguo 09/01/2011, 03:56
Avatar de Willy_N  
Fecha de Ingreso: diciembre-2009
Ubicación: Cádiz
Mensajes: 334
Antigüedad: 14 años, 4 meses
Puntos: 18
Respuesta: Formulario de contacto

En mi servidor no.
  #3 (permalink)  
Antiguo 09/01/2011, 09:12
Avatar de fernando2222  
Fecha de Ingreso: diciembre-2009
Mensajes: 110
Antigüedad: 14 años, 4 meses
Puntos: 1
Respuesta: Formulario de contacto

Alguien sabe decirme si hay algo mal en este codigo?

!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>contactoht</title>
<script 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_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 {
background-color: #999999;
}
-->
</style></head>

<body>
<form action="contact.php" method="POST" onsubmit="MM_validateForm('EmailFrom','','RisEmail ');MM_validateForm('Nombre','','R');MM_validateFor m('consulta','','R');return document.MM_returnValue">
<p>Email:<br>
<input type="text" name="EmailFrom">
<p>Nombre:<br>
<input type="text" name="Nombre">
<p>Apellido (opcional) <br>
<input type="text" name="Name">
<p>consulta:<br>
<textarea name="consulta" cols="30" rows="10"></textarea>
<p>

<p>
<input type="submit" name="submit" value="Enviar" />

</form>
<p>

<!-- Contact Form credit link -->

</body>
</html>

Y aqui va el de php


<?php
// Website Contact Form Generator
// http://www.tele-pro.co.uk/scripts/contact_form/
// This script is free to use as long as you
// retain the credit link

// get posted data into local variables
$EmailFrom = Trim(stripslashes($_POST['e-mail']));
$EmailTo = "[email protected]";
$Subject = "consulta uno";
$Nombre = Trim(stripslashes($_POST['Nombre']));
$Apellido= Trim(stripslashes($_POST['Apellido']));
$consulta = Trim(stripslashes($_POST['consulta']));

// validation
$validationOK=true;
if (Trim($EmailFrom)=="") $validationOK=false;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}

// prepare email body text
$Body = "";
$Body .= "Nombre: ";
$Body .= $Nombre;
$Body .= "\n";
$Body .= "Apellido: ";
$Body .= $Apellido;
$Body .= "\n";
$Body .= "consulta: ";
$Body .= $consulta;
$Body .= "\n";

// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
__________________
www.mshunderwear.com.ar la marca del momento....
  #4 (permalink)  
Antiguo 23/01/2011, 06:12
Avatar de fernando2222  
Fecha de Ingreso: diciembre-2009
Mensajes: 110
Antigüedad: 14 años, 4 meses
Puntos: 1
Respuesta: Formulario de contacto

Al menos una breve explicacion de como funciona?
__________________
www.mshunderwear.com.ar la marca del momento....
  #5 (permalink)  
Antiguo 29/01/2011, 07:16
Avatar de fernando2222  
Fecha de Ingreso: diciembre-2009
Mensajes: 110
Antigüedad: 14 años, 4 meses
Puntos: 1
Respuesta: Formulario de contacto

Gracias , ya encontré la solucion, mi servidor, no admite éste tipo de formularios, lo que no quiere decir que no sirva. En otro servidor funciona perfectamente y a alguien le puede servir.
__________________
www.mshunderwear.com.ar la marca del momento....

Etiquetas: contacto, servidores, formulario
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta

SíEste tema le ha gustado a 1 personas




La zona horaria es GMT -6. Ahora son las 03:32.