bonjour à tous
c'est mon premier sujet sur le fofo, en faite je suis un dev debutant j'ai un probléme c'est que ces pages n'ajoute pas dans la base
voilà le code des pages
ajouterta.php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
41
42
43
44
45
46
 
<!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>ajoutla</title>
</head>
 
<body>
<?php
include ("fonction.php");
?>
<form action="verif.php" method="post" target="_self"><table width="200" border="1">
  <tr>
    <td>Matricule</td>
    <td><input name="matricule" type="text" id="matricule" /></td>
  </tr>
  <tr>
    <td>Nom</td>
    <td><input name="nom" type="text" id="nom" /></td>
  </tr>
  <tr>
    <td>Prenom</td>
    <td><input name="prenom" type="text" id="prenom" /></td>
  </tr>
  <tr>
    <td>Nbrdv</td>
    <td><label>
      <input name="nbrdv" type="text" id="nbrdv" />
    </label></td>
  </tr>
  <tr>
    <td>equipe</td>
    <td><input name="equipe" type="text" id="equipe" /></td>
  </tr>
</table>
  <p>
    <label>
    <input type="submit" name="Submit" value="Envoyer" />
    </label>
    <input type="reset" name="Submit2" value="R&eacute;initialiser" />
  </p>
</form>
 
</body>
</html>
verif.php
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
41
<?php
include ("fonction.php");

connexion();


$matricule=$_POST['matricule'];
$nom=$_POST['nom'];
$prenom=$_POST['prenom'];
$nbrdv=$_POST['nbrdv'];
$equipe=$_POST['equipe'];


$sql="INSERT INTO utilisateur(matricule,nom,prenom,nbrdv,equipe) values('".$matricule."','".$nom."','".$prenom."','".$nbrdv."','".$equipe."',)";
$r=mysql_query($sql);
echo mysql_num_rows($r);

if($sql)
  {
    echo("L'insertion a été correctement effectuée") ;
  }
  else
  {
    echo("L'insertion à échouée") ;
  }



header("Location: ajouterta.php");

?>

fonction.php

<?php
function connexion()
{
mysql_connect('localhost','root','')  ;
mysql_select_db('rentabilux') ;
}
?>