Ver Mensaje Individual
  #3 (permalink)  
Antiguo 01/10/2012, 20:31
Avatar de rodeirojg
rodeirojg
 
Fecha de Ingreso: junio-2012
Ubicación: Buenos Aires
Mensajes: 86
Antigüedad: 11 años, 10 meses
Puntos: 2
Respuesta: Header Location Blank

Cita:
Iniciado por Triby Ver Mensaje
Con header() no puedes abrir páginas en ventanas (pestañas) nuevas, sólo en la actual.

Si tienes problemas con las otras opciones, muestra el código con el que lo has intentado y así, con algo en concreto, sería más fácil tratar de ayudarte.
Ya intenté cambiar el archivo y ahora agregué algunas funciones javascript para validar, el código del formulario es el siguiente:

Código PHP:
<head>

<
script type="text/javascript">

function 
validar(frm) {

  var 
resultado1 frm.nombre.value.length 3;
  var 
resultado2 = /^w+([.-]?w+)*@w+([.-]?w+)*(.w{2,6})$/.test(frm.email.value);
  var 
resultado3 frm.comentario.value.length 3;
  
  
document.getElementById('error').style.visibility = (resultado1) ? 'hidden':'visible';
  
document.getElementById('error').style.color = (resultado1) ? '#999':'red';
  
document.getElementById('input').style.borderColor = (resultado1) ? '#999':'red';
  
document.getElementById('input').style.color = (resultado1) ? '#999':'red';
  
  
document.getElementById('error2').style.visibility = (resultado2) ? 'hidden':'visible';
  
document.getElementById('error2').style.color = (resultado2) ? '#999':'red';
  
document.getElementById('input2').style.borderColor = (resultado2) ? '#999':'red';
  
document.getElementById('input2').style.color = (resultado2) ? '#999':'red';
  
  
document.getElementById('error3').style.visibility = (resultado3) ? 'hidden':'visible';
  
document.getElementById('error3').style.color = (resultado3) ? '#999':'red';
  
document.getElementById('input3').style.borderColor = (resultado3) ? '#999':'red';
  
document.getElementById('input3').style.color = (resultado3) ? '#999':'red';
  
  return  (
resultado1 && resultado2 && resultado3);
}

</script>

</head>
<body>
<form action="enviar.php" method="post" class="tipo" onsubmit="return validar(this)">

Nombre<input type="text" name="nombre" id="input" style="border-width: 1px; border-style: solid; border-color: #999"/>
<p id="error" style="visibility:hidden">Longitud invalida</p>

Email:
<input type="text" name="email" id="input2" style="border-width: 1px; border-style: solid; border-color: #999"/>
<p id="error2" style="visibility:hidden">E-mail invalido</p>

Comentario:
<textarea cols="30" rows="10" name="comentario" id="input3" style="border-width: 1px; border-style: solid; border-color: #999"></textarea>
<p id="error3" style="visibility:hidden">Texto no valido</p>

<input type="submit" />

</form>

</body>
</html> 
Lo que sucede es que quiero validar también con php en caso que alguien tenga desactivado javascript en el navegador, y así evito que hagan spam en mi casilla
__________________
Julian G. Rodeiro
Encargado del área de Diseño en:
www.brandestudio.com.ar