- 注册时间
- 2004-11-1
- 最后登录
- 2018-4-24
版主
  
- 积分
- 548
|

楼主 |
发表于 2009-3-13 15:44:14
|
显示全部楼层
终于写完了。现炒现卖的PHP,SQL,HTML方面的东西。还有不少BUG,不过管他呢,勉强能用就行。
- <?php
- session_start();
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
- <title>注册页面</title>
- </head>
- <body>
- <?php
- $_SESSION["Reg_Sucess"] = 0;
- $_SESSION["InputOK"] = 0;
- $_SESSION["Find"] = 0;
-
- if($_POST["NewUserName"] != 0 or $_POST["NewUserPwd"] != 0)
- {
- $_SESSION["InputOK"] = 1;
- }
-
- $SQL = mssql_connect("(local)","GameSrv","luna");
- if (!$SQL) echo "无法连接数据库";
-
- if(!mssql_select_db("lunamember")) echo "无法连接lunamember数据库!";
- $RegMemberInfo = mssql_query("select id_loginid from chr_log_info where id_loginid = '". $_POST["NewUserName"] ."'");
- while($MS = mssql_fetch_object($RegMemberInfo))
- {
- if($_POST["NewUserName"] == $MS->id_loginid)
- {
- $_SESSION["Find"] = 1;
- }
- }
-
- if($_SESSION["Find"] == 0 and $_SESSION["InputOK"] == 1)
- {
- $sql_index = mssql_query("select max(id_idx)mid from chr_log_info");
- $si = mssql_fetch_object($sql_index);
- $i = ($si->mid + 1).",";
- $n = "'". $_POST["NewUserName"] ."',";
- $p = "'". $_POST["NewUserPwd"] ."',";
- $s = "'". $_POST["NewSexType"] ."'";
-
- $sql_new_id = mssql_query("insert into chr_log_info(id_idx,propid,id_loginid,id_passwd,id_sextype) values(".$i.$i.$n.$p.$s.");");
- $_SESSION["Reg_Sucess"] = 1;
- }
- ?>
- [color=#0000ff]欢迎注册LunaOnline![/color]
- <hr/>
- <form action="reg.php" method="post">
- [table=800]
- [tr]
- [td]账号:[/td]
- [td]<input type="text" name="NewUserName" id="NewUserName" maxlength="16"/>[/td]
- [/tr]
- [tr]
- [td]密码:[/td]
- [td]<input type="password" name="NewUserPwd" id="NewUserPwd" maxlength="16"/>[/td]
- [/tr]
- [tr]
- [td]性别:[/td]
- [td]<select name="NewSexType" id="NewSexType">
- <option value="0">男</option>
- <option value="1">女</option></select> [/td]
- [/tr]
- [tr]
- [td]<input type="submit" name="register" id="register" value="注册" />[/td]
- [td][/td]
- [/tr]
- [/table]
- </form>
- <?php
- if($_SESSION["Reg_Sucess"] == 0 and $_SESSION["InputOK"] == 0 and $_SESSION["Find"] == 0)
- {
- echo '<hr/>[color=#ff0000]请检查是否已经正确的输入账号和密码?[/color]';
- }
-
- if($_SESSION["Reg_Sucess"] == 0 and $_SESSION["InputOK"] == 1 and $_SESSION["Find"] == 1)
- {
- echo '<hr/>[color=#ff0000]注册失败,是不是重名了?[/color]';
- }
- if($_SESSION["Reg_Sucess"] == 1 and $_SESSION["InputOK"] == 1 and $_SESSION["Find"] == 0)
- {
- echo '<hr/>[color=#ff0000]注册成功![/color]
- [url=shop01.php]返回登陆页面[/url]';
- }
- ?>
- <?php
- mssql_close($SQL);
- session_destroy();
- ?>
- </body>
- </html>
复制代码 其实写了四个版本,两个是在Delphi4PHP里面写的,一个面向对象,一个面向过程。结果Crack的D4P总是出错,无法正常使用。于是转Dreamweaver,不用vcl4php,又写了两个...... |
|