Hola estoy creando un formulario con código php y cuando procedo a introducir el nombre y el email este no advierte de que es incorrecto, tampoco funciona el link para el botón cuya función es la de descargar un archivo.
Aquí les dejo el código.
Código:
<?php
if (!$primeravez)
{
if (empty($_POST["name"]))
echo "<p class='error'>Falta rellenar el campo Nombre</p>";
if (empty($_POST["email"]))
echo "<p class='error'>Falta rellenar el campo Email</p>";
elseif (!eregi("^[a-zA-Z0-9_\-\.]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $_POST["email"]))
echo "<p class='error'>Email no válido</p>";
}
?>
<form id="form1" name="form1" method="post" action="conexion.php">
<table width="100%" border="0">
<tr>
<td>Name:</td>
<td colspan="2"><label for="name"></label>
<input type="text" name="name" id="name" value="<?php echo htmlspecialchars($_POST['name']); ?>"></td>
</tr>
<tr>
<td>Email</td>
<td colspan="2"><label for="email"></label>
<input type="text" name="email" id="email" value="<?php echo htmlspecialchars($_POST['email']); ?>"></td>
</tr>
<tr>
<td colspan="3"><input type="submit" name="Enviar" id="Enviar" value="Descargar" href="http://lcoalhost/public_html/Album sunshine.rar"/></td>
</tr>
</table>
</form>