<?php
require_once("../check.php");
require_once("../config.php");
isset($_POST['pass1'])?$pass1=$_POST['pass1']:$pass1=null;
isset($_POST['pass2'])?$pass2=$_POST['pass2']:$pass2=null;
isset($_POST['pass3'])?$pass3=$_POST['pass3']:$pass3=null;
$pass1 = sha1($pass1."www.dunling.com");
$sql = "select * from dunling_menber where username='$username' and userpass='$pass1'";
$ery = mysql_query($sql,$config)or die("mysql error");
$num = mysql_num_rows($ery);
if($num!="1"){
    echo "1";
    exit;
}
if($pass2 == $pass3){
$userpass = sha1($pass2."www.dunling.com");

$upsql = "update dunling_menber set userpass='$userpass' where username='$username'";
$upery = mysql_query($upsql,$config);
mysql_close();
echo 'ok';
}else{
    echo "error";
}
?>