Bonjour,
j ai créé une page php permettant de se connecter a une bd créé sous sql server 2000 et d ajouter un client a partir d un formulaire .
quand j exécute il n ya aucun message d erreur mais quand j ouvre la bd je trouve pa ce que j ai ajouter voila le code et aider moi svp:
<!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=iso-8859-1" />
<title>Document sans titre</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="ajout_clt.php">
<table width="200" border="1" align="center">
<tr>
<th scope="col">Identifiant</th>
<th scope="col"><input type="text" name="id_clt" /></th>
</tr>
<tr>
<th scope="row">Nom</th>
<td><input type="text" name="nom_clt" /></td>
</tr>
<tr>
<th scope="row">Prénom</th>
<td><input type="text" name="prenom_clt" /></td>
</tr>
<tr>
<th scope="row">Adresse</th>
<td><input type="text" name="adr_clt" /></td>
</tr>
<tr>
<th scope="row">Télephone</th>
<td><input type="text" name="tel_clt" /></td>
</tr>
<tr>
<th colspan="2" scope="row"><input type="submit" name="Submit" value="Enregistrer" /></th>
</tr>
</table>
</form>
</body>
<?
if(isset($_POST['id_clt']) and !empty($_POST['nom_clt']) and isset($_POST['prenom_clt']) and isset($_POST['adr_clt']) and isset($_POST['tel_clt']))
{
$id_clt=$_POST['id_clt'];
$nom_clt=$_POST['nom_clt'];
$prenom_clt=$_POST['prenom_clt'];
$adr_clt=$_POST['adr_clt'];
$tel_clt=$_POST['tel_clt'];
$server="DELL";
$username="";
$password="";
$sqlconnect=mssql_connect($server, $username, $password);
$sqldb=mssql_select_db("commandes",$sqlconnect);
mssql_query("insert into tab_clt(id_clt,nom_clt,prenom_clt,adr_clt,tel_clt) values('$id_clt','$nom_clt','$prenom_clt','$adr_clt','$tel_clt')");
mssql_close();
}
?>
</html>
merci
Configuration: Windows XP
Firefox 2.0.0.20