bbsreg.php
来自「bbs server linux平台下软件源码」· PHP 代码 · 共 140 行
PHP
140 行
<?php /** * This file registry a new id, work with bbsreg.html * by binxun 2003.5 */ $needlogin=false; require("funcs.php"); @$num_auth=$_POST["num_auth"]; @$userid=$_POST["userid"]; @$nickname=$_POST["username"]; @$realname=$_POST["realname"]; @$dept=$_POST["dept"]; @$address=$_POST["address"]; @$year=$_POST["year"]; @$month=$_POST["month"]; @$day=$_POST["day"]; @$reg_email=$_POST["reg_email"]; @$phone=$_POST["phone"]; @$gender=$_POST["gender"]; @$m_register=$_POST["m_register"]; @$mobile_phone=$_POST["mobile_phone"]; session_start(); if(!isset($_SESSION['num_auth'])) html_error_quit("请等待识别的图片显示完毕!"); if(strcasecmp($_SESSION['num_auth'],$num_auth)) html_error_quit("图片上的字符串识别错误!难道你是机器人?"); if(!strchr($reg_email,'@')) html_error_quit("错误的注册 email 地址!"); //generate passwd $password=bbs_findpwd_check("","",""); //create new id $ret=bbs_createnewid($userid,$password,$nickname); switch($ret) { case 0: break; case 1: html_error_quit("用户名有非数字字母字符或者首字符不是字母!"); break; case 2: html_error_quit("用户名至少为两个字母!"); break; case 3: html_error_quit("系统用字或不雅用字!"); break; case 4: html_error_quit("该用户名已经被使用!"); break; case 5: html_error_quit("用户名太长,最长12个字符!"); break; case 6: html_error_quit("密码太长,最长39个字符!"); break; case 10: html_error_quit("系统错误,请与系统管理员SYSOP联系."); break; default: html_error_quit("注册ID时发生未知的错误!"); break; }$mailbody="<?xml version=\"1.0\" encoding=\"gb2312\"><!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\"><html><body><P class=MsoNormal><FONT size=2><SPAN style=\"FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'\"> " . $realname . "欢迎您来到</SPAN><SPAN style=\"FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'\">BBS水木清华站。</SPAN></FONT></P><P class=MsoNormal><FONT size=2><SPAN style=\"FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'\">您的注册信息是:</SPAN></FONT></P><P class=MsoNormal><FONT size=2><SPAN style=\"FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'\">用户名:" . $userid . "</SPAN></FONT></P><P class=MsoNormal><FONT size=2><SPAN style=\"FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'\">姓名:" . $realname . "<SPAN></FONT></P><P class=MsoNormal><FONT size=2><SPAN style=\"FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'\">地区:" . $address . "</SPAN></FONT></P><P class=MsoNormal><FONT size=2><SPAN style=\"FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'\">密码:" . $password . "</SPAN></FONT></P><P class=MsoNormal><FONT size=2><SPAN lang=EN-US>email</SPAN><SPAN style=\"FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'\">:" . $reg_email . "</SPAN></FONT></P><P class=MsoNormal><FONT size=2><A href=\"https://www.smth.edu.cn\"><SPAN style=\"FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'\">点击这里登录BBS 水木清华</SPAN></body></html>";/* To send HTML mail, you can set the Content-type header. */$headers = "MIME-Version: 1.0\r\n";$headers .= "Content-type: text/html; charset=gb2312\r\n";/* additional headers */$headers .= "From: BBS水木清华站 <https://www.smth.edu.cn>\r\n";if(!mail($reg_email, "welcome to BBS水木清华站",$mailbody,$headers)) html_error_quit("发送密码到您的注册Email失败!请确认您的该Email地址正确"); if(!strcmp($gender,"男"))$gender=1; else $gender=2; settype($year,"integer"); settype($month,"integer"); settype($day,"integer"); settype($m_register,"bool"); if(!$m_register)$mobile_phone=""; if (BBS_WFORUM==0) { $ret=bbs_createregform($userid,$realname,$dept,$address,$gender,$year,$month,$day,$reg_email,$phone,$mobile_phone,TRUE);//自动生成注册单 } else { $ret=bbs_createregform($userid,$realname,$dept,$address,$gender,$year,$month,$day,$email,$phone,$mobile_phone, $_POST['OICQ'], $_POST['ICQ'], $_POST['MSN'], $_POST['homepage'], intval($_POST['face']), $_POST['myface'], intval($_POST['width']), intval($_POST['height']), intval($_POST['groupname']), $_POST['country'], $_POST['province'], $_POST['city'], intval($_POST['shengxiao']), intval($_POST['blood']), intval($_POST['belief']), intval($_POST['occupation']), intval($_POST['marital']), intval($_POST['education']), $_POST['college'], intval($_POST['character']), TRUE);//自动生成注册单 } switch($ret) { case 0: break; case 2: html_error_quit("该用户不存在!"); break; case 3: html_error_quit("生成注册单发生 参数错误! 请两天后手工填写注册单"); break; default: html_error_quit("生成注册单发生 未知的错误! 请两天后手工填写注册单"); break; } html_init("gb2312");?><body>申请BBS水木清华ID成功,你现在还没有通过身份认证,只有最基本的权限,不能发文,发信,聊天等,两天后系统会自动生成注册单.<br>注册单通过审核后,你将获得合法用户权限!<br/><a href="https://www.smth.edu.cn">现在登录进站</a></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?