me da error en la linea 73 que es la de :
Código:
en la linea 77 que es la : if ( is_numeric($_POST['year']) AND (strlen($_POST['year']) = = 4) ) {
Código:
y en la 83 que es :print '<p class="error" >Eigther you entered your birth year wrong or you come from the future!.</p>'>;
Código:
El código es el siguiente:} else { //Else para la priemra condicion.
Código PHP:
<!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=utf-8" />
<title>Registration</title>
<style type="text/css" media="screen" >
.error {color: red; }
</style>
</head>
<body>
<h2>Registration Results</h2>
<?php //Listado 6.4 - handle_reg.php
/*Este script recibe el nombreocho valores desde registrer.html:
email, password, confirm, month, day, year, color, submit */
//Gestionar la administracion de errores si se desea
//Marcar la variable para rastrear el proceso:
$okay = TRUE;
//Validar la direccion de correo electronico:
if (empty($_POST['email'])){
print '<p class="error">Please enter your email adress.</p>';
$okay = FALSE;
}
//--------------------------------------------------- Contraseña ----------------------------------------------------//
//Validar la contraseña:
if (empty($_POST['password'])){
print '<p class="error">Please enter your password.</p>';
$okay = FALSE;
}
//Comprobar la igualdad de las dos contraseñas:
if (empty($_POST['password']) != $_POST['confirm']) {
print '<p class="error">Your confirmed password does not match the original password.</p>';
$okay = FALSE;
}
//---------------------------------------------------Fecha de nacimiento-----------------------------------------------------//
//Validar la fecha de nacimiento:
$birthday = '';
//Validar el mes:
if (is_numeric($_POST['month'])) {
$birthday = $_POST['month'] . '-';
}
else {
print '<p class="error">Please select the month you were born.</p>';
$okay = FALSE;
}
//Validar dia:
if (is_numeric($_POST['day'])) {
$birthday .= $_POST['day'] . '-';
} else {
print '<p class="error">Please select the day you were born.</p>';
$okay = FALSE;
}
// Validar el año
if ( is_numeric($_POST['year']) AND (strlen($_POST['year']) = = 4) ) {
//Comprobar que el nacimiento due antes del 2009.
if ($_POST['year'] >= 2009) {
print '<p class="error" >Eigther you entered your birth year wrong or you come from the future!.</p>'>;
$okay = FALSE;
} else {
$birthday .= $_POST['year'];
} //Fin de la segunda condicion.
} else { //Else para la priemra condicion.
print '<p class="error">Please enter year you were born as four digitx.</p>';
$okay = FALSE;
} //fIN DE LA PRIMERA CONDICION
//--------------------------------------------------- another -----------------------------------------------------//
//Si no existe errores mostrar un mensaje:
if ($okay) {
print '<p>You have been successfully registrered (but not really).</p>';
print "<p>You entered your birthay as $birthday.</p>";
}
?>
</body>
</html>
Muchas gracias de antemano.