如果在输入会员名后就可以把会员的信息显示出来 ?

yuanxiaolei 2007-06-20 04:50:30
如果在输入会员名后就可以把会员的信息显示出来 ?
...全文
214 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
yuanxiaolei 2007-06-20
  • 打赏
  • 举报
回复
cu.asp文件内容

<%
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "No-Cache"
%>
<!--#include file="conn.asp"-->
<%
name=request.querystring("name")
Set rs = Server.CreateObject ("ADODB.Recordset")
sql = "Select * from u_ser where u_name='"&name&"'"
rs.Open sql,conn,1,1
if rs.eof and rs.bof then
response.write("可以注册")
else
response.write("已被注册")
end if
rs.close
set rs=nothing
call CloseDatabase
%>
yuanxiaolei 2007-06-20
  • 打赏
  • 举报
回复
t1.htm文件内容


<script language="javascript" type="text/javascript">
var xmlHttp = false;
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e2) {
xmlHttp = false;
}
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
xmlHttp = new XMLHttpRequest();
}

function callServer() {
var u_name = document.getElementById("u_name").value;
if ((u_name == null) || (u_name == "")) return;
var url = "cu.asp?name=" + escape(u_name);
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = updatePage;
xmlHttp.send(null);
}

function updatePage() {
if (xmlHttp.readyState < 4) {
test1.innerHTML="loading...";
}
if (xmlHttp.readyState == 4) {
var response = xmlHttp.responseText;
test1.innerHTML=response;
}
if (test1.innerHTML=="已被注册"){
document.form1.submit.disabled=true}else{
document.form1.submit.disabled=false
}
}
</script>


<form name="form1" action="t1.asp" method="post" autocomplete="off">
用户名: <input type="text" name="u_name" id="u_name" onChange="callServer();" />
<span id="test1">是否能注册</span><br>
密 码:<input type="password" />
<input type="submit" name="submit" value="注册" />
</form>
yuanxiaolei 2007-06-20
  • 打赏
  • 举报
回复
我有一个是可以检测会员名是否注册的,但是我想把会员的信息显示出来。网址:http://www.zzcx.net.cn/ajax.rar 表里有两个字段其他字段我还没有建,帮我把会员名的ID显示出来在下面。
coolbird88 2007-06-20
  • 打赏
  • 举报
回复
ajax

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧