RDV+DIAL chat illimit� dans ta r�g!
no save
Assistance
Achat
News

Forum | programmation
je veux afficher un message d'erreur avec php
wajdi83, le lun. 06 juil. 2009 à 01:44:25
Bonjour,
J'ai deux pages en php la première est pour l'identification et le deuxième est pour l'affichage du profil alors je veux afficher un message d'erreur en cas d'erreur d'identification
voila le code de mon premier page
<form name="form1" method="post" action="resultat_identification.php">
<table width="423" border="3" align="center" bgcolor="#00CCFF">
<tr>
<td width="141"><div align="center"><strong>Email </strong>: </div></td>
<td width="155"><label>
<div align="center">
<input name="mail" type="text" id="mail">
</div>
</label></td>
<td width="101"> <label>

<div align="center"> </div>
</label></td>
</tr>
<tr>
<td width="141"><div align="center"><strong>Mot de passe</strong>: </div></td>
<td width="155"><label>
<div align="center">
<input name="mot_de_passe" type="text" id="mot_de_passe">
</div>
</label></td>
<td width="101"> <label>

<div align="center">

</div>
</label></td>
</tr>
</table>
<p align="center"> 
<input type="submit" name="Submit" value="OK">
et la deuxième page

<?
$mail= htmlentities($_POST['mail']);
$mot_de_passe= htmlentities($_POST['mot_de_passe']);
mysql_connect("localhost","root","");
mysql_select_db("last");
$requete="select * from candidat where mail='$mail' and mot_de_passe='$mot_de_passe'";
$resultat=mysql_query($requete) or die("Erreur SQL : $query<br/>".mysql_error());
?>
<body>
<div align="center"><span class="Style1">Votre profil</span></div>
<p> </p>
<? while($enreg=mysql_fetch_array($resultat))
{
?>
<p>vous êtes le bienvenue: <span class="Style2"><? echo $enreg['prenom']; ?></span></p>
<table width="301" border="1" align="center" bgcolor="#0099FF">
<tr>
<td width="61"><div align="center"><strong><span class="Style5">Nom</span></strong></div></td>
<td width="76"><div align="center"><strong><span class="Style5">Prenom</span></strong></div></td>
<td width="87"><div align="center"><strong><span class="Style5">CIN</span></strong></div></td>
<td width="49"><div align="center"><span class="Style5"><strong>Etat civil</strong></span></div></td>
</tr>
<TR>
<TD> <? echo $enreg['nom']; ?> </TD>
<TD> <? echo $enreg['prenom']; ?> </TD>
<TD> <? echo $enreg['cin']; ?> </TD>
<TD> <? echo 2008-$enreg['etat_civil']; ?> </TD>
</TR>
<? } ?>
</table>Configuration: Windows Vista
Firefox 3.0.11


tiptop_ch
06 juil.
Suivant
REPONSES
tiptop_ch
06 juil.
wajdi83
06 juil.
wajdi83
07 juil.
tiptop_ch
07 juil.
wajdi83
07 juil.
Version Web
Réalisé par RedShift
no save