| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 736 人关注过本帖
标题:请问一下如何将页面设置成登录后才可以查看的呢?
只看楼主 加入收藏
langren417
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2012-8-14
结帖率:0
收藏
 问题点数:0 回复次数:4 
请问一下如何将页面设置成登录后才可以查看的呢?
请问一下如何将页面设置成登录后才可以查看的呢?
应该怎么修改啊???大侠们帮帮忙····

edayshop的商城程序 2.1的免费版····
搜索更多相关主题的帖子: 如何 
2012-09-12 16:32
ysf0181
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:55
帖 子:914
专家分:2385
注 册:2006-10-4
收藏
得分:0 
看来,楼主,对 session 和 cookies 没有感觉啊。

登录时
<%

session("zhanghao") = "用户名"


%>

登录后页面的头部加入
<%
if session("zhanghao") = "" then
   response.write "未登录"
   response.end
end if
%>
刚学的人都有这个现象,没事,多看下书吧

ASP讨论QQ群:251346273
2012-09-12 16:52
langren417
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2012-8-14
收藏
得分:0 
回复 2楼 ysf0181
好的··谢谢啦··我试下···
2012-09-12 17:05
langren417
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2012-8-14
收藏
得分:0 
回复 2楼 ysf0181
不行啊····
老大 ··帮我看看源码可以吗?
2012-09-12 17:28
langren417
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2012-8-14
收藏
得分:0 
你好!可以帮我看看这个源码吗?  设置为会员登录后才可以查看产品信息!!!
谢谢啦······

<script language="JavaScript">
function hydl1(){
    if (!document.hy_dl1.zh.value.match(/^[A-Za-z]w{0,19}$/)) {
        alert("帐号不正确!");
        document.hy_dl1.zh.focus();
        return false;
    }
    if (!document.hy_dl1.mm.value.match(/^w{3,20}$/)) {
        alert("密码不正确!");
        document.hy_dl1.mm.focus();
        return false;
    }
    if (!document.hy_dl1.yzm.value.match(/^w{4}$/)) {
        alert("验证码不正确!");
        document.hy_dl1.yzm.focus();
        return false;
    }
    return true;
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="31" align="center" valign="bottom" background="ima/glk_s.jpg">
      <table width="85%" border="0" cellspacing="0" cellpadding="5">
        <tr>
          <td><font color="#FFFFFF"><strong>会员登陆</strong></font></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td background="ima/glk_zo.jpg">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%
if session("hy")<>"yes" then
%>
        <tr>
          <td align="center">
<form action="hy_dl_yz.asp" method="post" name="hy_dl1" id="hy_dl1" onSubmit="return hydl1();">
              <table width="90%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td><img src="../ima/spacer.gif" width="1" height="5"></td>
                </tr>
                <tr>
                  <td><table width="100%" border="0" cellspacing="0" cellpadding="3">
                      <tr>
                        <td width="32%" align="right" valign="bottom">帐 号:</td>
                        <td width="68%"><input name="zh" type="text" class="bdxbk" id="zh2" size="12"></td>
                      </tr>
                      <tr>
                        <td align="right" valign="bottom">密 码:</td>
                        <td><input name="mm" type="password" class="bdxbk" id="mm2" size="12"></td>
                      </tr>
                      <tr>
                        <td align="right" valign="bottom">验证码:</td>
                        <td><input name="yzm" type="text" class="bdxbk" id="yzm2" size="4">
                          <font face="Arial Black" size="2" color="#FF6600">
                          <%
                  if session("hy_dl_yz")="" then
                  session("hy_dl_yz")=zmyzm()
                  end if
                  response.write session("hy_dl_yz")
                  %>
                          </font></td>
                      </tr>
                      <tr>
                        <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td background="ima/xx1.gif"><img src="ima/spacer.gif" width="1" height="1"></td>
                            </tr>
                          </table></td>
                      </tr>
                      <tr>
                        <td colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td>&nbsp;</td>
                              <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                  <tr>
                                    <td align="center"> <input name="imageField2" type="image" src="ima/dd_al.gif" align="middle" width="49" height="22" border="0">
                                    </td>
                                    <td valign="bottom"> <a href="hy_qm1.asp">忘记密码?</a>
                                      <a href="hy_zc.asp">注册</a></td>
                                  </tr>
                                </table></td>
                            </tr>
                          </table></td>
                      </tr>
                    </table></td>
                </tr>
                <tr>
                  <td><img src="../ima/spacer.gif" width="1" height="5"></td>
                </tr>
              </table>
            </form></td>
        </tr>
<%
else
lr_hy_jf001="select jf from hy where zh='"&session("hy_zh")&"'"
set rs_hy_jf001=conn.execute(lr_hy_jf001)
%>        
        <tr>
          <td align="center"><table width="90%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><img src="../ima/spacer.gif" width="1" height="5"></td>
              </tr>
              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="8">
                    <tr>
                      <td class="zjj1">亲爱的<strong> <font color="#FF6600">
                        <% =session("hy_zh") %>
                        </font></strong>您好!<br>
                        您的购物车有<strong><font color="#FF6600"><% response.write ubound(split(session("sp"),","))+1 %></font></strong>  件商品!<br>
                        您的所得积分是<strong><font color="#FF6600"><% =rs_hy_jf001("jf") %>
                        </font></strong>点</td>
                    </tr>
                    <tr>
                      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td><a href="hy___sy.asp">我的会员管理</a></td>
                            <td><a href="hy___tc.asp">安全退出&gt;&gt;</a></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table></td>
              </tr>
              <tr>
                <td><img src="../ima/spacer.gif" width="1" height="5"></td>
              </tr>
            </table></td>
        </tr>
    <%
    end if
    %>   
      </table> </td>
  </tr>
  <tr>
    <td><img src="ima/glk_x.jpg" width="190" height="12"></td>
  </tr>
</table>



这个是登录框   


<%
'=====================================================================
' 程序开发:E天科技有限公司
' 当前版本:ED-SC v2.1免费版
' 作者:夜雨天
' 技术咨询QQ:53107925
' 官方服务网站:www.
'=====================================================================
' Copyright 2008-2020 EDayNet - All Rights Reserved.
' is a trademark of EDayNet
'=====================================================================
%>
<!--#include file="inc/conn.asp" -->
<!--#include file="inc/function.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><% =rs_xtpz("mc") %>-<% =rs_xtpz("bt") %></title>
<meta name="keywords" content="<% =rs_xtpz("gjz") %>">
<meta name="description" content="<% =rs_xtpz("mc") %>-<% =rs_xtpz("ms") %>"><link href="inc/ys.css" rel="stylesheet" type="text/css">
<%
set rs_zxsp=server.createobject("adodb.recordset")
lr_zxsp="select top 12 bh,mc,scj,jg,tp1 from sp where xpf=true order by id desc"
rs_zxsp.open lr_zxsp,conn,1,1,1
set rs_rmsp=server.createobject("adodb.recordset")
lr_rmsp="select top 12 bh,mc,scj,jg,tp1 from sp where rmf=true order by id desc"
rs_rmsp.open lr_rmsp,conn,1,1,1
set rs_xw=server.createobject("adodb.recordset")
lr_xw="select top 7 id,zt,tjf from xw order by plwz asc"
rs_xw.open lr_xw,conn,1,1,1
set rs_gg2=server.createobject("adodb.recordset")
lr_gg2="select top 2 tp,wz from gg where ggwz=2 order by plwz asc"
rs_gg2.open lr_gg2,conn,1,1,1
%>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#FFE8E8">
      <!--#include file="inc/yt_jb.asp" -->
    </td>
  </tr>
  <tr>
    <td bgcolor="#FFE8E8"><img src="ima/spacer.gif" width="1" height="3"></td>
  </tr>
  <tr>
    <td align="center"><!--#include file="inc/DH.asp" --></td>
  </tr>
  <tr>
    <td align="center">
<!--#include file="inc/ss.asp" --></td>
  </tr>
  <tr>
    <td><img src="ima/spacer.gif" width="1" height="8"></td>
  </tr>
  <tr>
    <td align="center"><table width="900" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="190" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><!--#include file="inc/glk_hydl.asp" --></td>
              </tr>
              <tr>
                <td><img src="ima/spacer.gif" width="1" height="6"></td>
              </tr>
              <tr>
                <td> <!--#include file="inc/glk_spfl.asp" --> </td>
              </tr>
              <tr>
                <td><img src="ima/spacer.gif" width="1" height="6"></td>
              </tr>
              <tr>
                <td> <!--#include file="inc/glk_fhtz.asp" --> </td>
              </tr>
              <tr>
                <td><img src="ima/spacer.gif" width="1" height="6"></td>
              </tr>
              <tr>
                <td> <!--#include file="inc/glk_kfqq.asp" --> </td>
              </tr>
              <tr>
                <td><img src="ima/spacer.gif" width="1" height="6"></td>
              </tr>
              <tr>
                <td> <!--#include file="inc/glk_kfww.asp" --> </td>
              </tr>
              <tr>
                <td><img src="ima/spacer.gif" width="1" height="6"></td>
              </tr>
              <tr>
                <td>
                  <!--#include file="inc/glk_yqlj.asp" -->
                </td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table></td>
          <td width="10">&nbsp;</td>
          <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><table width="700" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td valign="top">
                        <!--#include file="inc/tpbh.asp" -->
                      </td>
                      <td width="8"><img src="ima/spacer.gif" width="1" height="1"></td>
                      <td width="290" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="31" align="center" valign="bottom" background="ima/xwk_s.jpg">
                              <table width="85%" border="0" cellspacing="0" cellpadding="5">
                                <tr>
                                  <td><font color="#FFFFFF"><strong>最新活动</strong></font></td>
                                </tr>
                              </table>
                            </td>
                          </tr>
                          <tr>
                            <td align="center" background="ima/xwk_zo.jpg">
                              <table width="90%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                  <td><img src="../ima/spacer.gif" width="1" height="5"></td>
                                </tr>
                                <tr>
                                  <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                      <tr>
                                        <td width="100" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%
while not rs_gg2.eof
%>


                                            <tr>
                                              <td><a href="http://<% =rs_gg2("wz") %>/" target="_blank"><img src="admins/<% =rs_gg2("tp") %>" width="100" height="60" border="0"></a></td>
                                            </tr>
                                            <tr>
                                              <td><img src="../ima/spacer.gif" width="1" height="5"></td>
                                            </tr>
                                            <%
                                            rs_gg2.movenext
                                            wend
                                            call gbdx(rs_gg2)
                                            %>
                                          </table>
                                        </td>
                                        <td width="10"><img src="../ima/spacer.gif" width="1" height="1"></td>
                                        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="1">
                                        <%
                                        while not rs_xw.eof
                                        if rs_xw("tjf") then
                                        ztys="#FF6600"
                                        else
                                        ztys="#666666"
                                        end if
                                        %>
                                            <tr>
                                              <td><font color="<% =ztys %>">■</font>
                                                <a href="xwzx.asp?id=<% =rs_xw("id") %>"><font color="<% =ztys %>"><% =gshwz(rs_xw("zt"),11,10) %></font></a></td>
                                            </tr>
                                            <tr>
                                              <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                  <tr>
                                                    <td background="ima/xx1.gif"><img src="ima/spacer.gif" width="1" height="1"></td>
                                                  </tr>
                                                </table></td>
                                            </tr>
                                            <%
                                            rs_xw.movenext
                                            wend
                                            %>
                                          </table></td>
                                      </tr>
                                    </table></td>
                                </tr>
                                <tr>
                                  <td><img src="../ima/spacer.gif" width="1" height="5"></td>
                                </tr>
                              </table></td>
                          </tr>
                          <tr>
                            <td><img src="ima/xwk_x.jpg" width="290" height="10"></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table> </td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td height="31" align="center" valign="bottom" background="ima/lmbt_bg.jpg">
                        <table width="95%" border="0" cellspacing="0" cellpadding="5">
                          <tr>
                            <td width="19%" align="center" class="z14"><strong><font color="#FFFFFF">最新商品</font></strong></td>
                            <td width="81%" align="right" valign="bottom"><a href="sp.asp?gm=1">更多&gt;&gt;</a></td>
                          </tr>
                        </table></td>
                    </tr>
                    <tr>
                      <td background="ima/lm_x_bg.jpg">&nbsp;</td>
                    </tr>
                    <tr>
                      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <%
                      if rs_zxsp.recordcount<>0 then
                      %>
                          <tr>
                            <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
                                <%
                                i=0
                                while not rs_zxsp.eof
                                if i mod 4=0 then
                                response.write "<tr valign=top>"
                                end if
                                %>
                                  <td>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
                                    <tr>
                                      <td align="center"><table width="100" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
                                          <tr>
                                              <td bgcolor="#FFFFFF"><a href="sp_xx.asp?bh=<% =rs_zxsp("bh") %>"><img src="admins/<% =rs_zxsp("tp1") %>" alt="<% =rs_zxsp("mc") %>" width="150" height="150" border="0"></a></td>
                                          </tr>
                                        </table></td>
                                    </tr>
                                    <tr>
                                      <td align="center" class="zjj1"><a href="sp_xx.asp?bh=<% =rs_zxsp("bh") %>">
                                        <% =rs_zxsp("mc") %>
                                        </a><br>
                                        编号:
                                        <% =rs_zxsp("bh") %>
                                          <br>
                                          市场价:<span class="scx"><font color="#006699"><% =formatnumber(rs_zxsp("scj"),2) %>元</font></span>
                                          <br>
                                          会员价 :<font color="#FF6600"><%
                                          if session("hy")="yes" then
                                          response.write formatnumber(rs_zxsp("jg"),2)&"元"
                                          else
                                          response.write "登陆才可见"
                                          end if
                                          %></font></td>
                                    </tr>
                                    <tr>
                                      <td align="center">&nbsp;</td>
                                    </tr>
                                  </table></td>
                                <%
                                    if i mod 4=3 then
                                    response.write "</tr>"
                                    end if
                                    i=i+1
                                    rs_zxsp.movenext
                                    wend
                                    %>
                              </table></td>
                          </tr>
                          <%
                          else
                          %>
                          <tr>
                            <td><table width="100%" border="0" cellspacing="0" cellpadding="50">
                                <tr>
                                  <td>正在更新中...</td>
                                </tr>
                              </table></td>
                          </tr>
                          <%
                          end if
                          %>
                        </table></td>
                    </tr>
                  </table></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td height="31" align="center" valign="bottom" background="ima/lmbt_bg.jpg">
                        <table width="95%" border="0" cellspacing="0" cellpadding="5">
                          <tr>
                            <td width="19%" align="center" class="z14"><strong><font color="#FFFFFF">热卖商品</font></strong></td>
                            <td width="81%" align="right" valign="bottom"><a href="sp.asp?gm=0">更多&gt;&gt;</a></td>
                          </tr>
                        </table></td>
                    </tr>
                    <tr>
                      <td background="ima/lm_x_bg.jpg">&nbsp;</td>
                    </tr>
                    <tr>
                      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <%
                      if rs_rmsp.recordcount<>0 then
                      %>
                          <tr>
                            <td><table width="700" border="0" cellspacing="0" cellpadding="0">
                                <%
                                i=0
                                while not rs_rmsp.eof
                                if i mod 4=0 then
                                response.write "<tr valign=top>"
                                end if
                                %>
                                  <td>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
                                    <tr>
                                      <td align="center"><table width="100" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
                                          <tr>
                                              <td bgcolor="#FFFFFF"><a href="sp_xx.asp?bh=<% =rs_rmsp("bh") %>"><img src="admins/<% =rs_rmsp("tp1") %>" alt="<% =rs_rmsp("mc") %>" width="150" height="150" border="0"></a></td>
                                          </tr>
                                        </table></td>
                                    </tr>
                                    <tr>
                                      <td align="center" class="zjj1"><a href="sp_xx.asp?bh=<% =rs_rmsp("bh") %>">
                                        <% =rs_rmsp("mc") %>
                                        </a><br>
                                        编号:
                                        <% =rs_rmsp("bh") %>
                                          <br>
                                          市场价:<span class="scx"><font color="#006699"><% =formatnumber(rs_rmsp("scj"),2) %>元</font></span>
                                          <br>
                                          会员价:<font color="#FF6600"><%
                                          if session("hy")="yes" then
                                          response.write formatnumber(rs_rmsp("jg"),2)&"元"
                                          else
                                          response.write "登陆才可见"
                                          end if
                                          %></font></td>
                                    </tr>
                                    <tr>
                                      <td align="center">&nbsp;</td>
                                    </tr>
                                  </table></td>
                                <%
                                    if i mod 4=3 then
                                    response.write "</tr>"
                                    end if
                                    i=i+1
                                    rs_rmsp.movenext
                                    wend
                                    %>
                              </table></td>
                          </tr>
                          <%
                          else
                          %>
                          <tr>
                            <td><table width="100%" border="0" cellspacing="0" cellpadding="50">
                                <tr>
                                  <td>正在更新中...</td>
                                </tr>
                              </table></td>
                          </tr>
                          <%
                          end if
                          %>
                        </table></td>
                    </tr>
                  </table></td>
              </tr>
              <tr>
                <td>&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td align="center"> <!--#include file="inc/yw.asp" --> </td>
  </tr>
  <tr>
    <td>
      <!--#include file="inc/yw_jb.asp" -->
    </td>
  </tr>
</table>
</body>
</html>
这个是首页源码  ··我想人家看产品信息都要登录之后才可以查看   要怎么修改啊···麻烦啦···谢谢你,,

2012-09-12 17:33
快速回复:请问一下如何将页面设置成登录后才可以查看的呢?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023546 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved