1.通过get或post获取前台传来的密码 $_POST['password'];2.md5函数加密: $pwd=md5($_POST['password']);3.写入数据库 insertintotable(name,pwd)value('name',$pwd);