时间:2021-07-01 10:21:17 帮助过:13人阅读
if($_GET['do'] =='add'){
if(!isset($_POST['porgnum']) && empty($_POST['porgnum'])){
echo '未填写登录名!';
}else if(!isset($_POST['porgname']) && empty($_POST['porgname'])){
echo '未填写昵称!';
}else if(!isset($_POST['ppasswd']) && empty($_POST['ppasswd'])){
echo '未填写密码!';
}else{
$orgid =$_POST['porgnum'];
$orgname =$_POST['porgname'];
$passwd =$_POST['ppasswd'];
$author =$_POST['pauthor'];
$con = mysql_connect(DB_HOST,DB_USER,DB_PASSWD);
mysql_select_db(DB_NAME,$con);
mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER_SET_CLIENT=utf8");
mysql_query("SET CHARACTER_SET_RESULTS=utf8");
if(!mysql_query("INSERT INTO `".DB_PRE."menber` (orgnum, orgname, passwd, power) VALUES ('$orgid', '$orgname', '$passwd', '$author')")){
die('错误!代码:' .mysql_error());
}else{
echo '注册成功!';
};
mysql_close($con);
};
登录名 名称 新密码 12
function new_org(){
var orgnum = j('#orgnum').val();
var orgname = j('#orgname').val();
var passwd = j('#passwd').val();
var author = j('#author').val();
j.ajax({
type:"POST",
url:"action.php?do=add",
data:{
porgnum:orgnum,
porgname:orgname,
ppasswd:passwd,
pauthor:author
},
dataType:"html",
cache:false,
async:false,
error:function(){
alert("发送失败!");
},
success:function(msg){
j('.admin_display').html(msg);
alert(orgnum);
}
});
};