Hello guys,
i have a form with the code below
[B] <form action=”annuaire.php” method=”post” name=”annuaire”>
<table width=”314″ border=”0″>
<tr>
<td width=”117″><span class=”Style16″>Nom: </span></td>
<td width=”187″><input type=”text” name=”nom” /></td>
</tr>
<tr>
<td><span class=”Style16″>Prénom: </span></td>
<td><input type=”text” name=”prenom” /></td>
</tr>
<tr>
<td><span class=”Style16″>Poste:</span></td>
<td><input type=”text” name=”poste” /></td>
</tr>
<tr>
<td><span class=”Style16″>Direction: </span></td>
<td><input type=”text” name=”direction” /></td>
</tr>
<tr>
<td><span class=”Style16″>GSM:</span></td>
<td><input name=”gsm” type=”text” maxlength=”8″ /></td>
</tr>
<tr>
<td><span class=”Style16″>fixe:</span></td>
<td><input name=”fixe” type=”text” maxlength=”8″ /></td>
</tr>
<tr>
<td><span class=”Style16″>email:</span></td>
<td><input name=”email” type=”text” maxlength=”50″ /></td>
</tr>
</table>
<input type=”submit” name=”Submit”value=”Ajouter” />
</form>
<p>
<?php
if(isset($_POST[‘Submit’])){
$nom = $_POST[‘nom’];
$prenom = $_POST[‘prenom’];
$poste = $_POST[‘poste’];
$direction = $_POST[‘direction’];
$gsm = $_POST[‘gsm’];
$fixe = $_POST[‘fixe’];
$email = $_POST[’email’];
mysql_connect(“localhost”,”root”,””) or die(mysql_error());
mysql_select_db(“maktaba”) or die(mysql_error());
$sql = ‘INSERT INTO annuaire VALUES(“”,”‘.$nom.'”,”‘.$prenom.'”,”‘.$poste.'”,”‘.$direction.'”,”‘.$gsm.'”,”‘.$fixe.'”,”‘.$email.'”)’;
mysql_query($sql)or die (‘Erreur SQL ! ‘.$sql.'<br/>’.mysql_error());
mysql_close();[/B]
[COLOR=”DarkRed”][B]The problem is that after submitting the form, i get an error page but all the informations given in the form are added to the database.
Can anyone help plz??