⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 webcode.asp

📁 最流行的HTTP服务器软件之一。快速、可靠、可通过简单的API扩展
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
'=====显示会员登陆窗口====='
'=====参数 t:为0时为纵向显示,为1时为横向显示
sub showuserlogin(t)
%>
<script language="javascript">
		function checklogin()
		{
		if (document.check_user.username.value=='')
		 {alert('请输入用户名');
		 document.check_user.username.focus();
		 return false
		 }
		 if (document.check_user.password.value=='')
		 {alert('请输入密码');
		 document.check_user.password.focus();
		 return false
		 }
		}
</script>
<%
if t=0 then
  if session("userid")="" or session("username")="" then


show_userlogin="<table width='80%' border='0' align='center' cellpadding='0' cellspacing='0'>"
show_userlogin=show_userlogin&"<form name='check_user' method='post' action='chkuser.asp?action=check' "
show_userlogin=show_userlogin&" onSubmit='return checklogin()'>"
show_userlogin=show_userlogin&"<tr>"
show_userlogin=show_userlogin&"<td colspan='2' align='center' height='15'></td>"
show_userlogin=show_userlogin&"</tr>"
show_userlogin=show_userlogin&"<tr>"
show_userlogin=show_userlogin&"<td height='30' align='center'>用 户:</td>"
show_userlogin=show_userlogin&"<td height='30'><input name='username' type='text' class='input_text' id='username' size='12'></td>"
show_userlogin=show_userlogin&" </tr>"
show_userlogin=show_userlogin&"          <tr>"
show_userlogin=show_userlogin&"            <td width='36%' height='30' align='center'>密 码:</td>"
show_userlogin=show_userlogin&"            <td width='64%' height='30'><input name='password' type='password' "
show_userlogin=show_userlogin&"class='input_text' id='password' size='12'></td>"
show_userlogin=show_userlogin&"          </tr>"
show_userlogin=show_userlogin&"          <tr>"
show_userlogin=show_userlogin&"            <td height='35' colspan='2' align='center'>"
show_userlogin=show_userlogin&"<input name='Submit' type='submit' class='login_bg' value='登 陆'>"
show_userlogin=show_userlogin&" <input name='Submit' type='button' class='login_bg' value='重 写'></td>"
show_userlogin=show_userlogin&"          </tr>"
show_userlogin=show_userlogin&"		  <tr>"
show_userlogin=show_userlogin&"		    <td colspan='2' align='center' height='30'><a href='reg.asp'>用户注册</a>  "
show_userlogin=show_userlogin&"<a href='password.asp'>忘记密码</a></td>"
show_userlogin=show_userlogin&"	      </tr>"
show_userlogin=show_userlogin&"		  <tr>"
show_userlogin=show_userlogin&"            <td colspan='2' align='center' height='8'></td>"
show_userlogin=show_userlogin&"          </tr>"
show_userlogin=show_userlogin&"		  </form>"
show_userlogin=show_userlogin&"        </table>"

else
		
		set rs=conn.execute("select id,username from cai_user where username='"&session("username")&"'")
		if rs.eof then
		response.Redirect("chkuser.asp?action=out")
		response.End()
		end if
show_userlogin=show_userlogin&"		<table width='70%' border='0' align='center' cellpadding='0' cellspacing='0'>"
show_userlogin=show_userlogin&"          <tr>"
show_userlogin=show_userlogin&"            <td colspan='2' align='center' height='15'></td>"
show_userlogin=show_userlogin&"          </tr>"
show_userlogin=show_userlogin&"          <tr>"
show_userlogin=show_userlogin&"           <td height='30' colspan='2' align='center'>欢迎您:"
show_userlogin=show_userlogin&"<span style='font-weight: bold'> "&session("username")&"</span></td>"
show_userlogin=show_userlogin&"          </tr>"
show_userlogin=show_userlogin&"          <tr>"
show_userlogin=show_userlogin&"            <td width='50%' height='30' align='center'><a href='myorder.asp'>我的定单</a></td>"
show_userlogin=show_userlogin&"            <td width='62%' height='30' align='center'><a href='user.asp'>修改资料</a></td>"
show_userlogin=show_userlogin&"          </tr>"
show_userlogin=show_userlogin&"          <tr>"
show_userlogin=show_userlogin&"        <td height='35' colspan='2' align='center'><a href='user.asp'></a> "
show_userlogin=show_userlogin&"<a href='chkuser.asp?action=out'>退出登陆</a></td>"
show_userlogin=show_userlogin&"          </tr>"
show_userlogin=show_userlogin&"		  <tr>"
show_userlogin=show_userlogin&"            <td colspan='2' align='center' height='15'></td>"
show_userlogin=show_userlogin&"          </tr>"
show_userlogin=show_userlogin&"        </table>"

end if

end if

if t=1 then

if session("userid")="" or session("username")="" then
show_userlogin=show_userlogin&"<table width='100%' height='30' border='0' cellpadding='0' cellspacing='0'>"
show_userlogin=show_userlogin&"<form name='check_user' method='post' action='chkuser.asp?action=check'"
show_userlogin=show_userlogin&"  onSubmit='return checklogin()'>"
show_userlogin=show_userlogin&"<tr>"
show_userlogin=show_userlogin&"<td> 用户名:"
show_userlogin=show_userlogin&"<input type='text' size='12' name='username' class='input_text'> 密 码:"
show_userlogin=show_userlogin&"    <input type='text' size='12' name='password' class='input_text'> "
show_userlogin=show_userlogin&"<input type='submit' name='Submit' class='login_bg' value='登 陆'>"
show_userlogin=show_userlogin&" <input type='submit' name='Submit' class='login_bg' value='重 写'> "
show_userlogin=show_userlogin&"    <a href='reg.asp'>用户注册</a> <a href='password.asp'>忘记密码</a></td>"
show_userlogin=show_userlogin&"  </tr>"
show_userlogin=show_userlogin&"  </form>"
show_userlogin=show_userlogin&"</table>"
else
set rs=conn.execute("select id,username from cai_user where username='"&session("username")&"'")
		if rs.eof then
		response.Redirect("chkuser.asp?action=out")
		response.End()
		end if
show_userlogin=show_userlogin&"<table width='100%' height='30' border='0' cellpadding='0' cellspacing='0'>"
show_userlogin=show_userlogin&"  <tr>"
show_userlogin=show_userlogin&"    <td> 用 户:<span style='font-weight: bold'> "&session("username")&"</span> "
show_userlogin=show_userlogin&"<a href='myorder.asp'>我的订单</a> <a href='user.asp'>修改资料</a> "
show_userlogin=show_userlogin&"<a href='chkuser.asp?action=out'>退出登陆</a></td>"
show_userlogin=show_userlogin&"  </tr>"
show_userlogin=show_userlogin&"</table>"
end if

end if

end sub

'=========显示最新新闻=====
sub showtopnews(n,l)
show_topnews="<table width='98%' border='0' align='center' cellpadding='0' cellspacing='0'>"
show_topnews=show_topnews&"              <tr>"
show_topnews=show_topnews&"                <td>"
show_topnews=show_topnews&"				<div>"

				set rs=conn.execute("select top "&n&" id,title,adddate from cai_news order by id desc")
				if rs.eof then

show_topnews=show_topnews&"				<li>没有资料</li>"

				end if
				while not rs.eof

show_topnews=show_topnews&"				<li><a href='shownews.asp?id="&rs(0)&"' title='"&rs(1)&"'>"&left(rs(1),l)&"</a></li>"
				rs.movenext
				wend

show_topnews=show_topnews&"				</div>"
show_topnews=show_topnews&"				</td>"
show_topnews=show_topnews&"              </tr>"
show_topnews=show_topnews&"            </table>"
end sub

'=========显示图片新闻=========
sub showpicnews(n,w,h,l)

set rs=conn.execute("select top "&n&" id,title,pic from cai_news where ispic=1 and right(pic,3)='jpg' order by id desc")
if not rs.eof then
do while not rs.eof
pics=pics+"|"&rs(2)&""
links=links+"|shownews.asp?id="&rs(0)&""
texts=texts+"|"&left(rs(1),l)&""
rs.movenext
loop
else
pics=pics+"|images/pic.jpg"
links=links+"|index.asp"
texts=texts+"|暂无数据"
set rs=nothing
end if
show_picnews="<script type=text/javascript>"&vbLf
show_picnews=show_picnews&" <!--"&vbLf
show_picnews=show_picnews&" var focus_width="&w&"     //场景宽"&vbLf
show_picnews=show_picnews&" var focus_height="&h&"  //场景高"&vbLf
show_picnews=show_picnews&" var text_height=18   //文字说明字高,为0时不显示文本"&vbLf
show_picnews=show_picnews&" var swf_height = focus_height+text_height"&vbLf
show_picnews=show_picnews&" var pics='"&Mid(pics,2)&"'"&vbLf
show_picnews=show_picnews&" var links='"&Mid(links,2)&"'"&vbLf
show_picnews=show_picnews&" var texts='"&Mid(texts,2)&"' "&vbLf
show_picnews=show_picnews&" document.write('<object ID=""focus_flash"" classid=""clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"" codebase=""http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"" width=""'+ focus_width +'"" height=""'+ swf_height +'"">');"&vbLf
show_picnews=show_picnews&" document.write('<param name=""allowScriptAccess"" value=""sameDomain""><param name=""movie"" value=""images/focus.swf""><param name=""quality"" value=""high""><param name=""bgcolor"" value=""#ffffff"">');"&vbLf
show_picnews=show_picnews&" document.write('<param name=""menu"" value=""false""><param name=wmode value=""opaque"">');"&vbLf
show_picnews=show_picnews&" document.write('<param name=""FlashVars"" value=""pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'"">');"&vbLf
show_picnews=show_picnews&" document.write('<embed ID=""focus_flash"" src=""images/focus.swf"" wmode=""opaque"" FlashVars=""pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'"" menu=""false"" bgcolor=""#ffffff"" quality=""high"" width=""'+ focus_width +'"" height=""'+ focus_height +'"" allowScriptAccess=""sameDomain"" type=""application/x-shockwave-flash"" pluginspage=""http://www.macromedia.com/go/getflashplayer""/>');  document.write('</object>');"&vbLf
show_picnews=show_picnews&"//-->"&vbLf
show_picnews=show_picnews&"</script>"&vbLf

end sub


'========显示产品分类======
sub showpclass
show_pclass="<table width='80%' border='0' align='center' cellpadding='0' cellspacing='0'>"
show_pclass=show_pclass&"         <tr>"
show_pclass=show_pclass&"            <td align='center' height='8'></td>"
show_pclass=show_pclass&"          </tr>"
		  set bigrs=conn.execute("select id,title from cai_class where followid=0 order by ordnum desc")
		  if bigrs.eof then
show_pclass=show_pclass&"          <tr>"
show_pclass=show_pclass&"            <td height='25'>没有分类</td>"
show_pclass=show_pclass&"          </tr>"

		  end if
		  while not bigrs.eof

show_pclass=show_pclass&"          <tr>"
show_pclass=show_pclass&"            <td height='25'><img src='images/product_icon.gif' > "
show_pclass=show_pclass&"			<strong><a href='product.asp?classid="&bigrs(0)&"'>"&bigrs(1)&"</a></strong></td>"
show_pclass=show_pclass&"  </tr>"

		  set smallrs=conn.execute("select id,title from cai_class where followid="&bigrs(0)&" order by ordnum desc")
		  while not smallrs.eof

show_pclass=show_pclass&"          <tr>"
show_pclass=show_pclass&"            <td height='25'>  <img src='images/product_icon.gif' >"
show_pclass=show_pclass&" <a href='product.asp?classid="&smallrs(0)&"'>"&smallrs(1)&"</a></td>"
show_pclass=show_pclass&"          </tr>"

		  smallrs.movenext
		  wend
		  
		  bigrs.movenext
		  wend

show_pclass=show_pclass&"		  <tr>"
show_pclass=show_pclass&"            <td align='center' height='8'></td>"
show_pclass=show_pclass&"          </tr>"
show_pclass=show_pclass&"</table>"
end sub
sub showpsort

show_psort="<select name='classid'>"
show_psort=show_psort&" <option>请选择分类</option>"
set big=conn.execute("select id,title from cai_class where followid=0")
while not big.eof
show_psort=show_psort&"<option value='"&big(0)&"'>"&big(1)&"</option>"
set small=conn.execute("select id,title from cai_class where followid="&big(0)&"")
while not small.eof
show_psort=show_psort&"<option value='"&small(0)&"'> "&small(1)&"</option>"
small.movenext
  wend

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -