1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| $error_new = array();
if ($nom = ""){$error_new = MSG18_MODPROFIL;}
if ($rue = ""){$error_new = MSG19_MODPROFIL;}
if (ereg("[0-9]{4}", $cp)){$error_new = MSG4_MODPROFIL;}
if ($lieu = ""){$error_new = MSG6_MODPROFIL;}
if (preg_match ("/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/", $datefin, $parts)) {$error_new = MSGDATEFIN_MODPROFIL;}
if(checkdate($parts[2],$parts[3],$parts[1])) {$error_new = MSGDATEFIN_MODPROFIL;}
if (preg_match ("/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/", $dated, $parts2)) {$error_new = MSGDATED_MODPROFIL;}
if(checkdate($parts2[2],$parts2[3],$parts2[1])) {$error_new = MSGDATED_MODPROFIL;}
if (preg_match ("/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/", $delaidinscription, $parts3)) {$error_new = MSGDELAI_MODPROFIL;}
if(checkdate($parts3[2],$parts3[3],$parts3[1])) {$error_new = MSGDELAI_MODPROFIL;}
if(empty($error_new)){
$sql = "UPDATE tirs SET nom='$nom', rue='$rue', lieu='$lieu', canton='$canton', cp='$cp', F300='$F300', P50='$P50', P25='$P25', P10='$P10', C50='$C50', C10='$C10', dated='$dated', delaidinscription='$delaidinscription', lien='$lien', datefin='$datefin', lat='$lat', lng='$lng' WHERE tirsID='$tirsID'";
$result = mysql_query($sql) or die ('Erreur SQL !'.$sql.'<br>'.mysql_error());
header ("Location: profilconfirm.php?lang=$lang");
}
else
{
$message_new = implode(", ", $error_new);
} |