par
lamk » 26 avr. 2005, 15:29
voilà j'te met le IF et la fin du formulaire, je sais pas si c'était ça que tu voulais...
echo "<div class='form-ligne'>";
echo "<div class='label'>Site :</div>";
echo "<div class='champ'><input name='site' type='text' size='50' maxlength='100' title='Saisir l adresse du site web du fabricant' value='";
echo $r_site;
echo "'></div>";
echo "</div>";
echo "<div class='form-ligne'>";
echo "<div class='boutons'>";
echo "<input type='submit' name='modif' value='Modifier'>";
echo "</div>";
echo "</div>";
echo "</form><br>";
if(isset($_POST['modif']))
{
if(($_POST['nom']==NULL) && ($_POST['nom']=="<br />")){echo "<font color='red'>Le nom du fabricant est obligatoire.</font>";}
$nom = htmlspecialchars($_POST['nom'], ENT_QUOTES);
$rue = htmlspecialchars($_POST['rue'], ENT_QUOTES);
$ville = htmlspecialchars($_POST['ville'], ENT_QUOTES);
$sql = "UPDATE `fabricant` SET `fab_rue`='".$rue."', `fab_cp`=".$_POST['cp'].", `fab_ville`='".$ville."', `fab_tel`='".$_POST['tel']."',
`fab_fax`='".$_POST['fax']."', `fab_site`='".$_POST['site']."', `fab_mail`='".$_POST['mail']."' WHERE `fab_nom`='".$liste."' ";
mysql_query("$sql") or die("<font color='red'>Invalid query : ".mysql_error()."</font>");
if($sql){echo "<font color='green'>Fabricant modifié.</font>";}
}
voilà j'te met le IF et la fin du formulaire, je sais pas si c'était ça que tu voulais...
[php] echo "<div class='form-ligne'>";
echo "<div class='label'>Site :</div>";
echo "<div class='champ'><input name='site' type='text' size='50' maxlength='100' title='Saisir l adresse du site web du fabricant' value='";
echo $r_site;
echo "'></div>";
echo "</div>";
echo "<div class='form-ligne'>";
echo "<div class='boutons'>";
echo "<input type='submit' name='modif' value='Modifier'>";
echo "</div>";
echo "</div>";
echo "</form><br>";
if(isset($_POST['modif']))
{
if(($_POST['nom']==NULL) && ($_POST['nom']=="<br />")){echo "<font color='red'>Le nom du fabricant est obligatoire.</font>";}
$nom = htmlspecialchars($_POST['nom'], ENT_QUOTES);
$rue = htmlspecialchars($_POST['rue'], ENT_QUOTES);
$ville = htmlspecialchars($_POST['ville'], ENT_QUOTES);
$sql = "UPDATE `fabricant` SET `fab_rue`='".$rue."', `fab_cp`=".$_POST['cp'].", `fab_ville`='".$ville."', `fab_tel`='".$_POST['tel']."',
`fab_fax`='".$_POST['fax']."', `fab_site`='".$_POST['site']."', `fab_mail`='".$_POST['mail']."' WHERE `fab_nom`='".$liste."' ";
mysql_query("$sql") or die("<font color='red'>Invalid query : ".mysql_error()."</font>");
if($sql){echo "<font color='green'>Fabricant modifié.</font>";}
}[/php]