注册程序如下,IIS6.02K3数据库是MYSQLODBC是最新版当新用户注册时,LOGINID长度不让超过5个字符,实际上数据库中这个字段是20个字符长库LOGINID=trim(request("LOGINID"))password=trim...
注册程序如下,IIS6.0 2K3 数据库是 MYSQL ODBC是最新版
当新用户注册时,LOGINID长度不让超过5个字符,实际上数据库中这个字段是20个字符长库
LOGINID = trim(request("LOGINID"))
password = trim(request("password"))
confirm_password = trim(request("confirm_password"))
if (LOGINID="") then
response.write "你丫没名字呀,滚回去"
response.end
end if
if (password="") then
response.write "你丫开门不用钥匙,想做贼呢"
response.end
end if
if (password <> confirm_password) then
response.write "两次输入的密码不一致!"
response.end
end if
password=md5(password)
password=mid(password,"9","16")
set rs=server.CreateObject("adodb.recordset")
strsql="select * from USER where username='"&trim(LOGINID)&"'"
rs.open strsql,conn,1,1
if not rs.eof then
response.write"注册失败!"
response.write"您输入的用户名已经存在,请重新输入!
href=javascript:history.go(-1)>按此返回"
rs.close
set rs=nothing
conn.close
set conn=nothing
else
rs.close
sql="select * from user"
rs.open sql,conn,1,3
rs.addnew
rs("username")=LOGINID
rs("password")=password
rs("latest_login_date")=now()
rs("user_priv")=1
rs("latest_login_ip")="127.0.0.1"
rs.update
response.write "恭喜您~,注册成功了~~~!"
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
这是表的DDL数据
-- Table "user" DDL
CREATE TABLE `user` (
`idx` int(11) NOT NULL auto_increment,
`username` varchar(20) NOT NULL default '',
`password` varchar(16) NOT NULL default '',
`deleted` smallint(6) NOT NULL default '0',
`user_priv` mediumint(9) NOT NULL default '0',
`locked` smallint(6) NOT NULL default '0',
`lock_begin` int(11) NOT NULL default '0',
`lock_end` int(11) NOT NULL default '0',
`create_date` int(11) NOT NULL default '0',
`from` int(11) NOT NULL default '0',
`latest_login_date` datetime NOT NULL default '0000-00-00 00:00:00',
`latest_login_ip` varchar(45) NOT NULL default '-',
PRIMARY KEY (`idx`),
KEY `username` (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
楼下的说法,我早就试过了,不行
展开