购物网站想添加个登陆了才可以显示价格的问题

lxcjsjf 2009-10-17 10:58:23
http://nforange.com/wanlian这个网站,我想让他变成登陆才可以显示价格,要怎么修改程序
...全文
154 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
小布 2009-10-17
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 lxcjsjf 的回复:]
引用 4 楼 tangcheng0 的回复:
用session啊。很简单的。思路就是
如果SESSION不等于空的时候。价格那一块才显示啊

if  session=("user") <> "" then
价格100元

像这样的。我以前就这样做过

这个是加在哪个文件里 哪个位置,详细一点谢谢

[/Quote]
加在你显示价格的页面的头部。
比如你显示页面时price.asp
你就在头部写上判断
if session("username")<>"" then
代码
end if
这样就OK
liuwei_IT_love 2009-10-17
  • 打赏
  • 举报
回复
学习
sy_binbin 2009-10-17
  • 打赏
  • 举报
回复
在会员登录的时候,设置SESSION值

然后在商品显示页面和商品列表页面中显示价格的地方,按照4楼的方法就可以了!
lxcjsjf 2009-10-17
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 tangcheng0 的回复:]
用session啊。很简单的。思路就是
如果SESSION不等于空的时候。价格那一块才显示啊

if  session=("user") <> "" then
价格100元

像这样的。我以前就这样做过
[/Quote]
这个是加在哪个文件里 哪个位置,详细一点谢谢
tangcheng0 2009-10-17
  • 打赏
  • 举报
回复
用session啊。很简单的。思路就是
如果SESSION不等于空的时候。价格那一块才显示啊

if session=("user") <> "" then
价格100元

像这样的。我以前就这样做过
lxcjsjf 2009-10-17
  • 打赏
  • 举报
回复
楼上的请说具体点,该改哪个文件,怎么改,谢谢
xb520hh 2009-10-17
  • 打赏
  • 举报
回复
用Cookie存储登录状态,判断如果登录状态为真则显示价格,反之则否
lxcjsjf 2009-10-17
  • 打赏
  • 举报
回复
就是如何实现登陆才能显示价格这个功能
lxcjsjf 2009-10-17
  • 打赏
  • 举报
回复
代码我发上来了,登陆成功的页面在哪啊
lxcjsjf 2009-10-17
  • 打赏
  • 举报
回复
<table border="0" cellpadding="0" cellspacing="0" width="795" id="table12" height="26">
<tr>
<td align="right" width="19">
<img border="0" src="Skin/<%=venshop_skin%>/index_t2.gif"></td>
<td align="center" width="70" bgcolor="#F2F2F2"><font color="#F96D06">网站公告:</font></td>
<td bgcolor="#F2F2F2"><%set rs=server.createobject("adodb.recordset")
sql="select * from norshop_pub order by ID DESC"
rs.open sql,conn,1,1
if rs.eof or rs.bof then%><p style="margin:0 5; "><font color="#FF0000">暂无公告<%else
i=0
do while not rs.eof
i=i+1%></font><a href="#" onclick="javascript:window.open('Notice-<%=rs("id")%>.html','newwindow','toolbar=no,scrollbars=yes,resizable=no,top=0,left=0,width=370,height=300');"><font color="#FF0000">
<%=rs("title")%>
</font></a><font color="#FF0000">  
<%
rs.movenext
loop
end if
rs.close
set rs=nothing
%>
</font>
</td>
<td width="6"><img border="0" src="Img/index_t3.gif" width="6" height="26"></td>
</tr>
</table>
<!-- 网站公告 END-->
<!-- 广告 Begin-->
<table border="0" cellpadding="0" cellspacing="0" width="795" id="table17">
<tr>
<td colspan="3" height="3"></td>
</tr>
<tr>
<%
vgoogle=0
if ad_img1<>"" then%>
<td align="center" width="33%">
<%if right(ad_img1,3)="swf" then
call showflash(ad_img1,260,105,img1)
else%>
<a href="<%=ad_url1%>" target=_blank><img border="0" onload=DrawImage(this,260) src="<%=ad_img1%>" ></a>
<%end if%>
</td>
<%
else
vgoogle=vgoogle+1
end if%>
<%if ad_img2<>"" then%>
<td align="center" width="34%">
<%if right(ad_img2,3)="swf" then
call showflash(ad_img2,260,105,img2)
else%>
<a href="<%=ad_url2%>" target=_blank><img border="0" onload=DrawImage(this,260) src="<%=ad_img2%>" ></a>
<%end if%>
</td>
<%else
vgoogle=vgoogle+1
end if%>
<%if ad_img3<>"" then%>
<td align="center" width="33%">
<%if right(ad_img3,3)="swf" then
call showflash(ad_img3,260,105,img3)
else%>
<a href="<%=ad_url3%>" target=_blank><img border="0" onload=DrawImage(this,260) src="<%=ad_img3%>" ></a>
<%end if%>
</td>
<%else
vgoogle=vgoogle+1
end if%>
<%
if int(vgoogle)>=3 then%>
<td align=center>
<%htmlend%>
</td>
<%end if
%>
</tr>
<%if huoshow=1 then%>
<tr>
<td colspan="3" height="20" bgcolor="#F5F5F5"> <font color="#0000FF">最新发货通知:</font>
<%set rs=server.createobject("adodb.recordset")
sql="select top 5 * from norshop_huo order by huo_id DESC"
rs.open sql,conn,1,1
if rs.eof or rs.bof then
else
do while not rs.eof%>
<a href="huo.asp?huo_id=<%=rs("huo_id")%>" target=_blank>
<%=rs("huo_name")%>
(<%=rs("huo_date")%>)</a> 
<%rs.movenext
loop
end if
rs.close
set rs=nothing%>
 <a target="_blank" href="huo.asp">更多>></a>
</td>
</tr>
<%end if%>
</table>


<!-- 广告 END-->
<!-- 热销排行 Begin-->

<!-- 热销排行 END-->
<!-- 推荐商品 -->
<table border="0" cellpadding="0" cellspacing="0" width="795" height="100">
<tr>
<td height="2" colspan="3"></td>
</tr>
<tr>
<td height="20" class="nb" width="20"></td>
<td height="20" bgcolor="#FFFFFF" width="2"></td>
<td class="tb" height="20" width="768"> 推荐商品  <a target="_blank" href="tuijian-1.html">
MORE>></a></td>
</tr>
<tr>
<td colspan="3" class="lrb"><table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<%if tjindex="" then tjindex=10
set rs=server.createobject("adodb.recordset")
rs.open "select top "&tjindex&" * from norshop_hw where tjindex=1 and hw_kucun>0 order by hw_id DESC",conn,1,1
i=0
i_t = 0
do while not rs.eof
i=i+1
i_t=i_t+1
if i>=6 then i=1%>
<td height="135" align="center" width="20%">
<table border="0" width="100%" id="table1" cellspacing="0" cellpadding="3">
<tr>
<td align="center" height="120"><a <%if photoh=1 then%>class=photo<%end if%> target="_blank" href="Pro<%=rs("hw_id")%>.html">
<img border="0" src="<%pic=split(rs("hw_pic"),"*")%><%=pic(1)%>" onload=DrawImage(this,100) onerror="this.src='img/noimage.jpg'" height="<%=heightt%>"></a></td>
</tr>
<tr>
<td align="center" height="20"><a target="_blank" href="Pro<%=rs("hw_id")%>.html"><%=rs("hw_name")%></a></td>
</tr>
<tr>
<td height="20" align="center"><font color="#FF0000">¥<%=rs("hw_price2")%>元</font></td>
</tr>
</table>
</td>
<%if i=5 and (tjindex-i_t)>=5 then%>
</tr>
<tr>
lxcjsjf 2009-10-17
  • 打赏
  • 举报
回复
<!--#include file="top.asp"-->
<%if t_is=1 then%>
<script LANGUAGE="javascript">
<!--
window.open ("show.asp", "newwindow","height=<%=t_height%>, width=<%=t_width%>, top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no")
-->
</script>
<%end if%>
<div id="Content" ><!--
<table width="980" border="0" cellpadding="0" bgcolor="#FFFFFF" height="100">
<tr>
<td width="181" valign="top" align="center">-->
<div id="ContentLeft">
<!-- left -->
<SCRIPT language="JavaScript1.1" src="inlogs.asp?venshop_skin=<%=venshop_skin%>"></SCRIPT>
<!--#include file="insort.asp"-->
<%
set rsven=server.createobject("adodb.recordset")
rsvensql="select top 1 ad_1 from norshop_venad"
rsven.open rsvensql,conn,1,1
%>
<%=rsven("ad_1")%>
<%
rsven.close
set rsven=nothing%>

<script language="javascript" src="inven.asp?ven_id=2"></script>
<%
set rsven=server.createobject("adodb.recordset")
rsvensql="select top 1 ad_2 from norshop_venad"
rsven.open rsvensql,conn,1,1
%>
<%=rsven("ad_2")%>
<%
rsven.close
set rsven=nothing%>

<%
if trim(vbanner)="1" then
htmlleft
end if
%>
<!-- left end -->
</div>
<!--</td>
<td valign="top" align="center">-->



<div id="ContentRight">
<!-- 网站公告 END-->
ayouori 2009-10-17
  • 打赏
  • 举报
回复
在登陆验证页面,就是会员登陆页的from指向的页面中,登陆成功内加入
session("username") = "username" 'username可以为登陆的用户名
在价格显示页的头部加入
username = session("username")
if username = "" or isempty(username) then
iflogined = true
else
iflogined = false
end if

上面代码处改为


</tr>
<tr>
<td height="20" align="center">
<%
if iflogined then '判断登陆情况,其它字段输出同理
%>
<font color="#FF0000">会员价¥ <%=rs("hw_price2")%>元 </font>
<%
else
%>
<font color="#FF0000">仅会员</font>
<%
end if
%>
</td>
</tr>
</table>
</td>
<%if i=5 and (tejia-i_p)>=5 then%>
</tr>
<tr>
<%end if%>
<%rs.movenext
loop
rs.close
set rs=nothing%>
</tr>
lxcjsjf 2009-10-17
  • 打赏
  • 举报
回复
</tr>
<tr>
<td height="20" align="center"><font color="#FF0000">会员价¥<%=rs("hw_price2")%>元</font></td>
</tr>
</table>
</td>
<%if i=5 and (tejia-i_p)>=5 then%>
</tr>
<tr>
<%end if%>
<%rs.movenext
loop
rs.close
set rs=nothing%>
</tr>
lxcjsjf 2009-10-17
  • 打赏
  • 举报
回复
代码太长了,发不上来,我们QQ上说行不,50741519 麻烦加下,谢谢
tangcheng0 2009-10-17
  • 打赏
  • 举报
回复
你可以把你要登陆的页面代码放上来。还有显示价格的那一块发上来。我帮你改一下。你照着那个做就行了

28,406

社区成员

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

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