源码

这个是一位朋友写的,再次谢过这个是gbk的,如果utf8的自己修改模版就可以了一:打开dede\inc\inc_menu.php查找:<m:itemname='注册会员列表'link='member_main.php'rank='member_List'target='main'/>加一行:<m:itemname='添加会员'link='member_add.php'rank='member_Add'target='main'/>然后刷新网站后台即可!二:在/dede/templates文件夹下面加一个模版文件member_add.htm代码如下<html><head><metahttp-equiv='Content-Type'content='text/html;charset=utf-8'><title>添加会员</title><linkhref='img/base.css'rel='stylesheet'type='text/css'><scriptlanguage='javascript'src='../data/enums/area.js'></script><script>functioncheckSubmit(){if(document.form2.email.value==""){document.form2.email.focus();alert("Email不能为空!");returnfalse;}if(document.form2.uname.value==""){document.form2.uname.focus();alert("用户昵称不能为空!");returnfalse;}}</script></head><bodybackground='img/allbg.gif'leftmargin='8'topmargin='8'><tablewidth="98%"border="0"align="center"cellpadding="3"cellspacing="1"bgcolor="#D1DDAA"><tr><tdheight="19"background="img/tbg.gif"><ahref='<?phpecho$ENV_GOBACK_URL;?>'><b>会员管理</b></a>&gt;&gt;添加会员</td></tr><tr><tdheight="200"bgcolor="#FFFFFF"align='center'><tablewidth="98%"border="0"cellspacing="0"cellpadding="6"><tr><tdcolspan="2"height="10"></td></tr><formname="form2"action="member_add.php"method="post"onSubmit="returncheckSubmit();"><inputtype="hidden"name="dopost"value="add"/><tr><tdwidth="17%"align="right"class='bline'>用户名:</td><tdwidth="83%"class='bline'><inputname="userid"type="text"value=""id="userid"size="20"style="width:150px;height:20px"/></td></tr><tr><tdalign="right"class='bline'>密 码:</td><tdclass='bline'><inputtype="text"name="pwd"id="pwd"/></td></tr><tr><tdalign="right"class='bline'>用户类型:</td><tdclass='bline'><?phpecho$row['mtype'];?><inputtype="radio"name="mtype"class="np"value="个人"checked='1'/>个人&nbsp;<inputtype="radio"name="mtype"class="np"value="企业"/>企业</td></tr><tr><tdalign="right"class='bline'>电子邮箱:</td><tdclass='bline'><inputname="email"type="text"id="email"value="<?phpecho$row['email']?>"style="width:150px;height:20px"/></td></tr><tr><tdalign="right"class='bline'>昵 称:</td><tdclass='bline'><inputname="uname"type="text"value="<?phpecho$row['uname']?>"id="uname"size="20"style="width:150px;height:20px"/></td></tr><tr><tdalign="right"class='bline'>性 别:</td><tdclass='bline'><inputtype="radio"name="sex"class="np"value="男"checked='1'/>男&nbsp;<inputtype="radio"name="sex"class="np"value="女"/>女<inputtype="radio"name="sex"class="np"value=""/>保密</td></tr><tr><tdalign="right"class='bline'>等级:</td><tdclass='bline'><?php$MemberTypes='';$dsql->SetQuery("Selectrank,membernameFrom`#@__arcrank`whererank>0");$dsql->Execute('n');$MemberTypes[0]="限制会员";while($nrow=$dsql->GetObject('n')){$MemberTypes[$nrow->rank]=$nrow->membername;}$options="<selectname='rank'style='width:80px'>\r\n";foreach($MemberTypesas$k=>$v){if($k!=$row['rank'])$options.="<optionvalue='$k'>$v</option>\r\n";else$options.="<optionvalue='$k'selected>$v</option>\r\n";}$options.="</select>\r\n";echo$options;?></td></tr><tr><tdheight="67"align="right">&nbsp;</td><tdheight="67"><inputtype="submit"name="Submit"value="确定添加"class='coolbg'/>&nbsp;&nbsp;<inputtype="reset"name="Submit22"value="重置表单"class='coolbg'/></td></tr></form></table></td></tr></table></body></html>三:在/dede目录下增加一个member_add.php文件代码如下<?phprequire(dirname(__FILE__)."/config.php");$ENV_GOBACK_URL=isset($_COOKIE['ENV_GOBACK_URL'])?"member_main.php":'';if($dopost=="add"){$jointime=$logintime=time();$loginip=$joinip=GetIP();$pwd=md5($pwd);$dsql->ExecuteNoneQuery("INSERTINTO#@__memberSET`mtype`='$mtype',`userid`='$userid',`pwd`='$pwd',`uname`='$uname',`sex`='$sex',`rank`='$rank',`money`='$money',`email`='$email',`scores`='$scores',`matt`='0',`face`='',`safequestion`='0',`safeanswer`='$safeanswer',`jointime`='$jointime',`joinip`='$joinip',`logintime`='$logintime',`loginip`='$loginip';");ShowMsg('成功添加一个用户',$ENV_GOBACK_URL);exit();}else{includeDedeInclude('templets/member_add.htm');}?>搞定效果如下图转:http://blog.sina.com.cn/s/blog_a12d17790101ixon.html

2013-5-4 4029 0