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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<title>Consultation</title>
</head>
<body style="background-color: #ffcc00;">
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" >
<fieldset>
<p align="center"><strong><font size="+2" face="Verdana, Arial, Helvetica, sans-serif">Pour
afficher les coordonnées d'une personne, saisir son nom et valider:</font></strong></p>
<p align="center"><font size="+2" face="Verdana, Arial, Helvetica, sans-serif">
<legend></legend>
</font></p>
<p align="center"> <strong>Nom de la personne enregistrée:<br>
</strong> <br>
<input type="text" name="nom" width="60" />
<br>
<br>
<input type="submit" value="Envoyer " name="envoi" />
<br>
<p align="center">
<?php
if(isset($_POST['envoi']))
{
if (isset($_POST['nom']) && ($_POST['nom'] != ""))
{
if (file_exists("clients.txt"))
{
if($id_file=fopen("clients.txt","r"))
{
flock($id_file,1);
$i = 0 ;
$tab = file("clients.txt");
for ($i = 0 ; $i < count ($tab); $i++) // parcourir le fichier
{
$datum = explode (":", $tab[$i]);
if ($_POST["nom"] == $datum[0])
{
echo "<b>Client N°".$i."<br></b>";
echo "Nom: ",$datum[0],"<br>";
echo "Prénom: ",$datum[1],"<br>";
echo "E-mail: ",$datum[2],"<br>";
echo "Mot de passe: ",$datum[3],"<br>";
echo "Date d'inscription: ".date("d/m/y", $datum[4])."<br>";
echo "<br>" ;
}
}
flock($id_file,3);
fclose($id_file);
}
else {echo "Le fichier où se trouve le nom est actuellement utilisé pour le moment, réessayez plus tard.";}
}
else {echo "Le fichier où se trouve le nom n'existe pas ou plus.";}
}
else {echo "Saissisez le nom s'il vous plaît.";}
}
?>
</body>
</html> |
Partager