Php of change login dates !!!!

06/29/2013 01:35 corei7pro#1
Hey guys, I was watching the administrator of Blue Orbit Server not give the code from your site, so I decided to start doing things myself ...
Here I leave the data change form, which is still in development but if someone wants to do the original as DarkOrbit, then so be it ...
Quote:
<?php
//error("WAIT.");
$dbhost = 'localhost';
$dbname = 'darkorbit';
$dbuser = 'root';
$dbbg = '';
$username = isset($_POST['username']) ? $_POST['username'] : '';
$password = isset($_POST['password']) ? $_POST['password'] : '';
$newpassword = isset($_POST['newpassword']) ? $_POST['newpassword'] : '';
$confirmpassword = isset($_POST['confirmpassword']) ? $_POST['confirmpassword'] : '';
$newmail = isset($_POST['newmail']) ? $_POST['newmail'] : '';
mysql_connect($dbhost, $dbuser, $dbbg)or error("Could not connect: ".mysql_error());
mysql_select_db($dbname) or error(mysql_error());

if (!isset($_POST['submit'])) {
} else {
// Ufff aqui viene la parte confusa
$result = mysql_query("SELECT pwHash FROM users WHERE Name='$username' and pwHash = '".md5($password)."'")or die("Query failed: " . mysql_error());if(mysql_num_rows($result)){ if($newpassword==$confirmpassword){
$sql=mysql_query("UPDATE users SET pwHash='".md5($newpassword)."' where Name='$username'");
$sql=mysql_query("UPDATE users SET Email='$newmail' where Name='$username'");
if($sql)
{
echo "Password Cambiada";
}
else
{
echo "Error, contacta a Feer";
}
} else {
// Si la confirmacion y la otra no coinciden este error
echo "La password nueva no coincide con su confirmacion.";
}
} else {
echo "El usuario y la password actual no coinciden.";
}
}
?>
<div class="pageContent">
<div id="main">
<div class="container">
<h2>Cambiar Contraseņa</h2>
</div>
<div class="container">
<?php
echo '<form action="" method="post">';
echo '<h2>Username: </h2><input type="text" name="username" size="50" maxlength="255"><br/>';
echo '<h2>Password: </h2><input type="password" name="password" size="50" maxlength="255"><br/>';
echo '<h2>Nueva Password: </h2><input type="password" name="newpassword" size="50" maxlength="255"><br/>';
echo '<h2>Confirmar Password: </h2><input type="password" name="confirmpassword" size="50" maxlength="255"><br/>';
echo '<h2>Nuevo Mail: </h2><input type="text" name="newmail" size="50" maxlength="255"><br/>';
echo '<input type="submit" name="submit" value="Cambiar Datos">';
echo '</form>';
?>
Insert in here your mysql password -> $dbbg = 'youpassword';
leave him if you do not have blank password...
This still developing as I said before, where this UserName have to put the username you have at this time.