It's a authentification form but i dont think it's very secured, so i would like to know how i can ameliorate the security of this authentification :
// The form
<form method="post" action="identification.php">
<table border="0" cellpadding="2" cellspacing="0">
<tr>
<td align="right">ID :</td><td align="left"><input type="text" name="identifiant"></td>
</tr><tr>
<td align="right">Mot de passe :</td><td align="left"><input type="password" name="password"></td>
</tr><tr>
<td align="center" colspan="2"><input type="submit" value="S'identifier" name="action"></td>
</tr>
</table>
</form>
// The php script
$identifi="0";
// we check if the form has been validated
if(isset($POST[action])) {
if(empty($POST[identifiant]) OR empty($POST[password])) {
echo "<i>Fields empty</i><br><br>";
} else {
$select="SELECT * FROM membre WHERE id='$POST[identifiant]' AND password='$POST[password]'";
$query=mysql_query($select);
$numrows=mysql_numrows($query);
if($numrows!="1") { echo "<i>Authentification Error</i><br><br>"; }
else {
$SESSION[identifiant]=$POST[identifiant];
$SESSION[password]=$_POST[password];
$nom=mysql_result($query,"0","nom");
$prenom=mysql_result($query,"0","prenom");
$identifi="1";
}
}
}
// we check if the session already exists
elseif(!empty($SESSION[identifiant]) AND !empty($SESSION[password])) {
$select="SELECT * FROM membre WHERE id='$SESSION[identifiant]' AND password='$SESSION[password]'";
$query=mysql_query($select);
$numrows=mysql_numrows($query);
if($numrows=="1") { $identifi="1"; }
}
if($identif=="1") { blabla bla.... }
else { echo "youre not identified"; }
Thank you in advance (sorry for my english)