1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| <?php
if (!empty($_POST["action"])) // passe ici seulement à la deuxième mise à jour de la page
{
$tonChamp = $_POST['tonChamp'];
$erreur = 0 ;
if($tonChamp == "")
{
$erreur = 1;
$erreur_tonChamp = "Champ vide";
}
if(@$erreur == 0)
{
//se que tu veut faire s'il n'y pas d'erreur
}
}
?>
<html>
<head>
<title></title>
</head>
<body>
<form action="" method="post" name="form_tonChamp">
<table border="0">
<tr>
<td align="right" > <b>tonChamp :</b> </td>
<td><input name="tonChamp" type="text" size="20" value="<?php echo @$tonChamp ?>"></td>
<td width="200px"> <?php if(@$erreur == 1 && @$erreur_tonChamp != "") echo $erreur_tonChamp ; ?> </td>
</tr>
</table>
<br><br>
<input type="hidden" name="action" value="ok">
<input type="submit" value="OK">
</form>
</body>
</html> |