帮我写一段简单的代码

s111 2003-10-25 01:32:26
在一个表格里,如果未登陆显示登陆框,登陆后变为用户信息
登陆框和用户信息不用提供
另问:在一个表格加了
<!--#include file=inc/top.asp-->
不知道是加的太多了,还是怎么了,页面执行速度很慢,换成普通代码就好了,
可是我还是想分开管理,怎么办
...全文
37 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
lastman001 2003-10-25
  • 打赏
  • 举报
回复
谢谢了
pzlk 2003-10-25
  • 打赏
  • 举报
回复
这儿有: http://zhy.cmaya.com/htmls/net/01.htm
lastman001 2003-10-25
  • 打赏
  • 举报
回复
再问一句在那可找到这方面的资料呀
谢谢
ygghost 2003-10-25
  • 打赏
  • 举报
回复
超文本传输协议 以 文本形式 传输
lastman001 2003-10-25
  • 打赏
  • 举报
回复
不好意思
我就是不太清楚
看到了就想问一下
能说的具体点么
ygghost 2003-10-25
  • 打赏
  • 举报
回复
楼主,这样的问题其实无所谓的,
http-equiv="Content-Type" 好象是http传输协议的方式
lastman001 2003-10-25
  • 打赏
  • 举报
回复
不好意思
我问一下http-equiv="Content-Type" 是什么意思呀
一直不明白
wzgan 2003-10-25
  • 打赏
  • 举报
回复
'登陆页面

<table width="189" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" height="120" align="center">
<tr>
<td height="157" valign="top" bordercolor="#f2f8ff">
<% if session("name")<>"" then%>
欢迎你<%=session("name")%>
<%else%>
<form name="form1" method="post" action="yhzccheck.asp">
<br>
会员
<input name="name" type="text" size="18">
<br>
<br>
密码
<input name="password" type="text" size="18">
<br>
        
<input type="button" name="Submit2" value="注册" onclick="window.open('yhzc.asp')">
  
<input type="submit" name="Submit" value="提交">
</form>
<%end if%></td>
</tr>
</table></td>
</tr>
<tr>
<td height="139" valign="top" bgcolor="#f2f8ff"> <table width="180" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><img src="pic/qytj.gif" width="189" height="20"></td>
</tr>
</table>
<table width="189" border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" height="119" align="center">
<%set rs=server.CreateObject("adodb.recordset")
sql="select top 8 * from qytj"
rs.open sql,conn,2,3
do while not rs.eof
%>
<tr>
<td valign="top" bordercolor="#f2f8ff"> <a href="quye.asp?id=<%=rs("id")%>"><%=rs("firmname")%></a></td>
</tr>
<%rs.movenext
loop%>
</table>

'检查用户页面

<!--#include file="inc/conn.asp"-->

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>

<BODY>
<%
name=trim(request("name"))
password=trim(request("password"))
if name="" or password="" then
response.write"<center>用户名或密码不能为空!</center>"
Response.Write"<meta http-equiv='refresh' content='1;url=index.asp'>"
else
set rs = server.CreateObject("ADODB.Recordset")
sql="select * from yhzc where name='"&name&" '"
rs.open sql,conn,3,3
if rs.eof then
Response.Write"<center>用户名:<b>"&name&"</b>不存在!</center>"
Response.Write"<meta http-equiv='refresh' content='1;url=yhzc.asp'>"
end if
do while not rs.eof

if trim(rs("password"))=password then
Response.Write"<center>登陆成功!</center>"
session("name")=name
Response.Write"<meta http-equiv='refresh' content='1;url=index.asp'>"
else
Response.Write"<center>密码错误!</center>"
Response.Write"<meta http-equiv='refresh' content='1;url=index.asp'>"
end if
rs.movenext
loop
rs.close
set conn=nothing
end if
%>
</BODY>
</HTML>
purexu 2003-10-25
  • 打赏
  • 举报
回复
<%If IsLogined Then%>
登录代码
<%Else%>
信息代码
<%End IF%>

include不要加太多,每一个include相当于每一个页面请求
ygghost 2003-10-25
  • 打赏
  • 举报
回复
这要用2个frame
左右或上下结构
左边是类目,右边是内容,
开始显示一个登陆框,进入框架页。
这样做会规范些

28,391

社区成员

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

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