Profil bloqué
-
Modifié par dangelot le 28/09/2012 à 10:49
Bonjour,
je suis à la recherche d'une aide sur la facon dont je peux faire la recherche dans une base de donnee via un formulaire HTML avec comme interpreteur PHP.
Voici mon petit conde:
<html>
<head>
<title>Bonjour le Monde</title>
</head>
<body>
<?php
include("connexion.php");
if(isset($_POST['rech']))
{
include("verifrech.php");
}
?>
<form action="#" method="POST">
<table>
<tr>
<td>Matricule</td><td><input type="text" name="matr" size="50"></td>
</tr>
<tr>
<td>Nom</td><td><input type="text" name="nom" size="50"></td>
</tr>
<tr>
<td>Adresse</td><td><input type="text" name="adr" size="50"></td>
</tr>
<tr>
<td><input type="submit" name="rech" value="Rechercher"></td><td><input type="reset" name="reset" value="Annuler"></td>
</tr>
</table>
</form>
</body>
</html>
voici le fichier <strong>verifrech</strong> que j'ai appalé:
<?php
$mat=$_POST['matr'];
$nom=$_POST['nom'];
$adres=$_POST['adr'];
if(empty($mat) or empty($nom) or empty($adres))
{
echo"Les espaces vides ne sont pas permis";
}
else
{
$exist=mysql_query("select* from personnel where Matricule='$mat'");
$nb=mysql_num_rows($exist);
if($nb!=0)
{
echo $_Post['MATRICULE'];
echo $_Post['NOM'];
echo $_Post['ADRESSE'];
}
}
?>
Je suis à la recherche d'une aide pour qu'il y ait l'affichage sur mon formulaire.
Si vous avez une solution, suis impatient de la recevoir.