我想在下面的代码中读取数据库USER 表中 USER =NAME (数据库中的)字段 的值WEBRUL 值请问怎么来 添加 这段代码 请各位高手大哥帮忙啊!谢谢了
<!-- #include file="conn.asp" -->
<SCRIPT Language=javascript>
<!--
function fucCheckTEL(TEL)
{
 var i,j,strTemp;
 strTemp="0123456789-()# ";
 for (i=0;i<TEL.length;i++)
 {
  j=strTemp.indexOf(TEL.charAt(i)); 
  if (j==-1)
  {
  //说明有字符不合法
   return 0;
  }
 }
 //说明合法
 return 1;
}
function fucCheckPrice(Price)
{
 var i,j,strTemp;
 strTemp="0123456789";
 for (i=0;i<Price.length;i++)
 {
  j=strTemp.indexOf(Price.charAt(i)); 
  if (j==-1)
  {
  //说明有字符不合法
   return 0;
  }
 }
 //说明合法
 return 1;
}
function CheckData2()
{
 if (form2.title.value == "") 
 { 
  window.alert("标题不能为空!!");
  return false;
 }
 else if (form2.price.value == "")
 {
  window.alert("价格不能为空!!");
  return false;
 }
 else if (fucCheckPrice(form2.price.value) == 0)
 {
  window.alert("价格需为整数!!");
  return false;
 }
 else if (form2.intro.value == "")
 {
  window.alert("内容不能为空!!");
  return false;
 }
 else if (fucCheckTEL(form2.phone.value) == 0)
 {
  window.alert("电话格式不对!!");
  return false;
 }
 else//通过所有检查
  form2.submit(); //送出表单中的数据
}
-->
</SCRIPT>
<%
username=trim(Request.Form("username"))
userpass=trim(Request.Form("userpass"))
if username<>"" and userpass<>"" then
 exec_index="select * from [user] where name='"&username&"' and password='"&userpass&"'"
 set rs=server.createobject("adodb.recordset")
 rs.open exec_index,conn,1,3
 if not rs.eof then
     userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
        If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR")
     rs("user_ip")=userip
  rs("user_lastlogintime")=now()
  rs.update
  session("user")=username
 else
%>
 <SCRIPT Language=javascript>
 <!--
  window.alert("用户名或密码错误!!");
 -->
 </SCRIPT>
<%
 end if
end if
%>
<html>
 <head>
  <TITLE>欢迎光临中国狗市——宠物交易网</TITLE>
  <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
 </head>
 <link rel="stylesheet" href="css.css">
 <body leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
 
 
 <table width="760" border="1" align="center" cellpadding="0" cellspacing="0">
 <tr> 
     <td colspan="3"><!-- #include file="head.asp" --></td>
   </tr>
  <tr> 
     <td height="25" colspan="3"><!-- #include file="menu.asp" --></td>
   </tr>
   
 <tr valign="top"> 
  <%
   if session("user")="" then
  %>
  <td width="192" height="150"> 
      <!-- #include file="left.asp" --></td>
  <%
   else
  %>
  <td width="192" height="150"> 
      <!-- #include file="left_user.asp" --></td>
  <%
   end if
  %>
     
    <td height="570" width="570" rowspan="2" colspan="2">
 
 
 
<%
set rs=server.createobject("adodb.recordset")
sql = "select * from sclass"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
        <%
        count = 0
        do while not rs.eof 
        %>
subcat[<%=count%>] = new Array("<%= trim(rs("sclass_name"))%>","<%= trim(rs("sclass_parent"))%>","<%= trim(rs("sclass_id"))%>");
        <%
        count = count + 1
        rs.movenext
        loop
        rs.close
        %>
onecount=<%=count%>;
function changelocation(locationid)
    {
    document.form2.sclass.length = 0; 
    var locationid=locationid;
    var i;
    for (i=0;i < onecount; i++)
        {
            if (subcat[i][1] == locationid)
            { 
                document.form2.sclass.options[document.form2.sclass.length] = new Option(subcat[i][0], subcat[i][2]);
            }        
        }
        
    }    
</script>
<form method="post" action="putout_ok.asp" name="form2">
        <table width="570" border="0.5" cellpadding="0" cellspacing="0" bordercolor="#999999">
          <tr> 
            <td width="79" height="25" align="right"> </td>
            <td colspan="2"> </td>
          </tr>
          <tr> 
            <td height="25" align="right">种类:  </td>
            <td colspan="2"> <select name="kind" id="kind">
                <option value="出 售">出 售</option>
                <option value="求 购">求 购</option>
                <option value="配 种">配种服务</option>
                <option value="宣 传">展示宣传</option>
              </select>
              *务必选正确</td>
          </tr>
          <%
   exec_putout1="select * from bclass"
   set rs=server.createobject("adodb.recordset")
   rs.open exec_putout1,conn,1,1
   idd=rs("bclass_id")
  %>
          <tr> 
            <td height="25" align="right">分类:  </td>
            <td colspan="2"> <select name="bclass" onChange="changelocation(document.form2.bclass.options[document.form2.bclass.selectedIndex].value)">
                <option value='<%=rs("bclass_id")%>'"><%=rs("bclass_name")%></option>
                <%
   rs.movenext
   do while not rs.eof
  %>
                <option value='<%=rs("bclass_id")%>'"><%=rs("bclass_name")%></option>
                <%
   rs.movenext
   loop
   rs.close
  %>
              </select> 
              <%
   set rs=server.createobject("adodb.recordset")
   sql = "select * from sclass where sclass_parent="&idd
   rs.open sql,conn,1,1
  %>
              <select name="sclass">
                <%
   do while not rs.eof
  %>
                <option value='<%=rs("sclass_id")%>'"><%=rs("sclass_name")%></option>
                <%
   rs.movenext
   loop
   rs.close
  %>
              </select> </td>
          </tr>
          <tr> 
            <td height="25" align="right">标题:  </td>
            <td colspan="2"><input name="title" type="text" id="title" maxlength="15">
              *请直接描述,请勿使用不雅字眼,
<input type="hidden" name="hits" value="0">
            </td>
          </tr>
          <tr> 
            <td height="25" align="right">价格:  </td>
            <td colspan="2"> 
              <input name="price" type="text" id="price" maxlength="5"  onKeyUp="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" value="0">
              元      *请使用整数,求购信息不能确定价格时请写0</td>
          </tr>
          <tr valign="top"> 
            <td height="135" align="right">内容:  </td>
            <td width="372"><textarea name="intro" id="intro" cols="70" rows="10"></textarea> 
            </td>
            <td width="119" valign="middle">*内容请详细描述您的物品,诸如几成新等等。请注明交易方式、时间、联系方法</td>
          </tr>
          <tr> 
            <td align="right">商品图片:  </td>
            <td colspan="2">
              <input type="text" name="pic" id="pic">
              *上传图片后该项系统自动填写</td>
          </tr>
          <tr> 
            <td colspan="3"><IFRAME src="upfile.asp" frameBorder=0 width="100%" height="30" scrolling=no height=21></IFRAME></td>
          </tr>
          <tr> 
            <td height="25" align="right">有效期:  </td>
            <td colspan="2"> <select name="expiredays" id="expiredays">
                <option value="45" yes>45</option>
                <option value="30">30</option>
                <option value="20">20</option>
                <option value="15">15</option>
                <option value="10">10</option>
                <option value="7">7</option>
                <option value="5">5</option>
                <option value="3">3</option>
              </select>
              天</td>
          </tr>
          <tr> 
            <td height="25" align="right">手机/电话:  </td>
            <td colspan="2"><input name="phone" type="text" id="phone" maxlength="20">
              *在内容中注明了其他联系方式,此项可以不填</td>
          </tr>
          <tr>
            <td align="right">信息推送:  </td>
            <td colspan="2"><input name="ifpush" type="checkbox" id="ifpush" value="push">
              *若选择该项系统将会发送小纸条提示与你这条信息相关的信息(详情请参阅帮助)</td>
          </tr>
          <tr> 
            <td align="right"> </td>
            <td colspan="2"> </td>
          </tr>
          <tr> 
            <td></td>
            <td height="25" colspan="2" align="left"><input type="button" value="发布信息" onClick="CheckData2()"></td>
          </tr>
          <tr> 
            <td align="right"> </td>
            <td colspan="2"> </td>
          </tr>
          <tr> 
            <td height="25" align="right">提示:</td>
            <td colspan="2"> </td>
          </tr>
          <tr> 
            <td height="25" align="right">1.</td>
            <td colspan="2"> 请在发布信息前先搜索</td>
          </tr>
          <tr> 
            <td height="25" align="right">2.</td>
            <td colspan="2"> 如您发布信息成功后发现信息有误,请到用户面板中修改信息</td>
          </tr>
          <tr> 
            <td height="25" align="right">3.</td>
            <td colspan="2"> 如果该信息已成交,请到用户面板中修改信息状态,防止别人打扰</td>
          </tr>
          <tr> 
            <td height="25" align="right"></td>
            <td colspan="2">  </td>
          </tr>
        </table>
</form>
 
 
 
 </td>
     
   </tr>
 <tr>
  <td valign="top">
   
  </td>
 </tr>
   <tr> 
     <td height="55" colspan="3"><!-- #include file="foot.asp" --></td>
   </tr>
 </table>
 </body>
</html>



											
	    

	

