<?php
require_once("../check.php");
require_once("../../config.php");
isset($_POST['id'])?$id=$_POST['id']:$id=null;
isset($_POST['username'])?$username = $_POST['username']:$username = null;

    $sql = "select username,rand from dunling_user where username='$username'";
    $ery = mysql_query($sql,$config); 
    $list = mysql_fetch_array($ery);
    $rand = $list['rand'];
    $uspass = sha1("888888".$rand);

$uppasssql = "update dunling_user set userpass='$uspass' where username='$username'";
$ok = mysql_query($uppasssql,$config);
mysql_close();
if($ok){
    echo "ok";
}
?>