码迷,mamicode.com
首页 > 其他好文 > 详细

老八系统简易调用AJAX

时间:2014-05-29 15:02:30      阅读:382      评论:0      收藏:0      [点我收藏+]

标签:c   style   class   blog   code   java   

 

bubuko.com,布布扣
<script src="js/jquery-1.7.2.min.js"></script>
 <script>
        $(function(){
            $("#txtaccount").blur(function(){
                 $.post("check.asp",
                 {
                    name:$(this).val(),
                    type:"tjnickname"
                  },
                  function(data,status){
                      if(data==‘0‘){
                    $("#nicknamemsg").html("&nbsp;&nbsp;<font color=‘green‘>会员编号不存在</font>");
                      }
                      else{
                      $("#nicknamemsg").html("&nbsp;&nbsp;<font color=‘green‘> " + data + " </font>");
                      }
                  });
            });
        })
    </script>
  
bubuko.com,布布扣

check.asp

bubuko.com,布布扣
<!--#include file="inc/common.asp"-->
<%
    Response.ContentType = "text/html"
    Response.Charset = "GB2312"
    dim rs,sql,rs1,sql1
    opendb()
    if request.form("type")="useraccount" then
        set rs=server.CreateObject("Adodb.Recordset")
        sql="select 1 from members where User_Account=‘"&request("name")&""
        rs.open sql,con

        if rs.eof or rs.bof then
            response.Write "0"
        else
            response.Write "1"
        end if
         
        rs.close()
        set rs=nothing
    end if 

    if request.form("type")="tjnickname" then
        set rs=server.CreateObject("Adodb.Recordset")
        sql="select User_NickName from members where User_Account=‘"&request("name")&"‘ and User_Check = 1"
        rs.open sql,con

        if rs.eof or rs.bof then
            response.Write "0"
        else
            response.Write rs("User_NickName")
        end if
         
        rs.close()
        set rs=nothing
    end if 

    if request.form("type")="regcenter" then
        set rs=server.CreateObject("Adodb.Recordset")
        sql="select User_ID,Reg_Center_ID from Reg_Center where Reg_Center_Code=‘"&request("name")&"‘ and Reg_Check = 1"
        rs.open sql,con
        if rs.eof or rs.bof then
            response.Write "0"
        else
            set rs1=server.CreateObject("Adodb.Recordset")
            sql1 = "select User_NickName from members where User_ID="& rs("User_ID") &""
            rs1.open sql1,con
            response.Write rs1("User_NickName")
            rs1.close()
            set rs1 = nothing    
        end if
        rs.close()
        set rs = nothing
       
    end if 

    closedb()
%>
bubuko.com,布布扣

 

老八系统简易调用AJAX,布布扣,bubuko.com

老八系统简易调用AJAX

标签:c   style   class   blog   code   java   

原文地址:http://www.cnblogs.com/mssql8/p/3758568.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!