<H4>Changement du mot de passe</h4>
<p><a href="index.php?id=reg ">Enregistrement</a></p>
<br><br>
<ul>
<LI> Votre Speudo Account ne doit pas etre le meme que votre mot de passe.<BR>
<LI> Votre Speudo account et mot de passe doit etre compris entre 4 et 15 charactere .<BR>
<LI> Votre Speudo Account devient aussi celui du login du jeu donc choisissez le bien.<BR>
<LI>Les Speudo Account et Mot de Passe doivent etre ecrit en mode englais, les numeraires sont autoriser.<BR><BR><BR>
</ul>
<script type="text/javascript">//<![CDATA[
function isAlphaNumeric(value)
{
if (value.match(/^[a-zA-Z0-9]+$/))
return true;
else
return false;
}
function checkform(f)
{
if (f.account.value=="")
{
alert("Fill all fields of of the form ");
return false;
}
if (!isAlphaNumeric(f.account.value))
{
alert("Fill all fields of of the form");
return false;
}
if (f.oldpassword.value=="")
{
alert("You didnt put your old password");
return false;
}
if (f.newpassword.value=="")
{
alert("No password detected in the field");
return false;
}
if (!isAlphaNumeric(f.newpassword.value))
{
alert("44444");
return false;
}
if (f.newpassword2.value=="")
{
alert("You didnt type password again");
return false;
}
if (f.newpassword.value!=f.newpassword2.value)
{
alert(" Password are not the same ");
return false;
}
return true;
}
//]]></script>
</head>
<body>
<form method="post" action="index.php?id=changepassword" onSubmit="return checkform(this)">
<table>
<tr>
<td>Speudo Account</td>
<td><input maxlength="15" name="account" type="text" /></td>
</tr>
<tr>
<td>Ancien Mot de Passe</td>
<td><input maxlength="15" name="oldpassword" type="password" /></td>
</tr>
<tr>
<td>Nouveau Mot de Passe</td>
<td><input maxlength="15" name="newpassword" type="password" /></td>
</tr>
<tr>
<td>Retaper le nouveau Mot de Passe </td>
<td><input maxlength="15" name="newpassword2" type="password" /></td>
</tr>
<tr>
<td colspan="2" style="text-align: center;"><br /><input type="submit" name="submit" value="Changer" /></td>
</tr>
</table>
</form>
<?php
if(ereg("^([a-zA-Z0-9_-])*$", $_POST['account']) && ereg("^([a-zA-Z0-9_-])*$", $_POST['oldpassword']) && ereg("^([a-zA-Z0-9_-])*$", $_POST['newpassword']) && ereg("^([a-zA-Z0-9_-])*$", $_POST['newpassword2']))
{
if ($page='index.php' && $_POST['account'] && strlen($_POST['account'])<16 && $_POST['oldpassword'] && $_POST['newpassword'] && $_POST['newpassword']==$_POST['newpassword2'])
{
$result=mysql_query("SELECT login,password FROM accounts WHERE login='".@mysql_real_escape_string($_POST['account'])."' AND password='".base64_encode(pack('H*', sha1($_POST['oldpassword'])))."'", $link)
or die ("Error: ".mysql_error());
if (mysql_num_rows($result))
{
mysql_query("UPDATE accounts SET password='".base64_encode(pack('H*', sha1($_POST['newpassword'])))."' WHERE login='".mysql_real_escape_string($_POST['account'])."'", $link)
or die ("Error: ".mysql_error());
print "<p style=\"font-weight: bold;\">Password has been changed. </p>";
}
else
print "<p class=\"error\">That's it : ( something went wrong, give another try. </p>";
mysql_close($link);
}
}
else
{
echo "Restrictions have not been tested for safety. If you are confident that had the correct information, please refer to the administration .";
}
?><br><br><br><br><br><br><br><br>
|