Voila, j'ai un soucis avec mon code :
PHP :
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Confirmation d'ajout</title>
</head>
<body>
<?
include "config.php";
$prenom = $_POST['prenom'];
$nom = $_POST['nom'];
$mail_p = $_POST['mail_pr'];
if ( $_POST['adresse'] == "Oui" )
{ $mail = ".\nAdresse : ".$prenom{0}"&.".$nom."@xxx.com"; }
else $mail = "";
//connection à mysql
$connect = mysql_connect("$user","$login","$pwd");
mysql_select_db($NomBase,$connect);
$requete = "select * from $NomTable;";
$res = mysql_db_query($NomBase,$requete,$connect);
$nbres = mysql_num_rows($res);
mysql_query("INSERT INTO `collab` ( `nom` , `prenom` , `mail_pr` ) VALUES ('$nom','$prenom','$mail_p') ") or die ("erreur insert ".mysql_error());
mysql_close($connect);
//fin de la connection
?>
</body>
</html>
HTML :Code : Tout sélectionner
<html>
<head>
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<title>Formulaire </title>
<?
include "config.php";
?>
<td align="center" valign="top"><h2>Formulaire d'arrivée</h2></td>
</tr>
</table>
<?
include "menu_nord.php";
?>
<form method="post" name="form" action="ajout_nord.php" onsubmit="return verif_arriv()" >
<table>
<tr>
<td><p class="txt"><img src="images/info.png" title="nom" alt="Nom">
Nom :</p></td>
<td><input type=text name="nom">
<img src="images/important.png" alt="important" title="important">
</td>
</tr>
<tr>
<td><p class="txt"><img src="images/info.png" title="prénom" alt="Prénom">
Prénom :</p></td>
<td><input type=text name="prenom">
<img src="images/important.png" alt="important" title="important">
</td>
</tr>
</tr>
<tr>
<td>
<p class="txt">
<img src=images/mail.png title="mail" alt="Création d'une Messagerie">
Création d'une Messagerie :</p></td>
<td>
<SELECT NAME="adresse">
<option>Mail ?</option>
<option>Oui</option>
<option>Non</option>
</SELECT>
<img src="images/important.png" alt="important" title="important">
</td>
<td>
<span class="txt">eMail :
<INPUT type="text" name="mail_pr"size="28"></span>
</td>
</tr>
</html>quand on choisie la case oui :/