标题:有没有帮我看看这个问题,网页提示缺少end
只看楼主
cartaion
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2012-11-5
结帖率:66.67%
已结贴  问题点数:20 回复次数:2 
有没有帮我看看这个问题,网页提示缺少end
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
    function readcounter(textfile)'这个读取counter
        dim fso,ts
        set fso = server.createobject("scripting.filesystemobject")
        set ts = fso.opentextfile(server.mappath(textfile),1,true)
        if not ts.atendofstream then
            readcounter=clng(ts.readline)
        else
            readcounter=10
        end if
        ts.close
        set ts=nothing
        set fso=nothing
    end function
            
    sub writecounter(textfile,counter)'这个写入counter
        dim fso,ts
        set fso = server.createobject("scripting.filesystemobject")
        set ts = fso.opentextfile(server.mappath(textfile),2,true)
        application.lock
        counter=counter+1
        application.unlock
        ts.writeline(counter)
        ts.close
        set ts=nothing
        set fso=nothing               
    end sub
    counterxin=readcounter("xin.txt")
    counterhua=readcounter("hua.txt") '得到相应点击的图片文件里记得counter
    if request("leibie")="hua" then'如果是花的话就写入花相应的counter文件,只有这一个的时候不出问题,但是在有其他的判断的时候总是提示缺少end
        call writecounter("\www\asp_text\application\hua.txt",counterhua)
    else if request("leibie")="xin" then
        call writecounter("\www\asp_text\application\xin.txt",counterxin)
    end if
%>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>明星投票系统</title>
    <style>
        * { margin:0; padding:0; }
        body { font-size:12px; color:#99CC33; background-color:#FFCCCC; font-family:Arial, Helvetica, sans-serif; }
        #image { width:445px; margin:5px auto; background-color:#99FFFF; }
        #image dl { background-color:#CCFFFF; float:left; margin:5px; }
        #image dl dt { margin:0 auto; }
        #image dl dt img { width:80px; height:80px; display:block; margin:2px auto; }
        #image dl dt a img { border:0; }
        #image dl dd { background-color:#CC66CC; line-height:20px; text-align:center; }
        #image dl dd p { font-size:14px; color:#FFFFFF; }
        #image dl dd p span { background-color:#CC3300; margin:auto 2px; }
    </style>
</head>

<body>
    <div id="image">
        <dl>
            <dt><a href="star.asp?leibie=xin" ><img src="image/xin.png"></a></dt>
            <dd><p>心:<span>
            <%=readcounter("\www\asp_text\application\xin.txt")%></span>票</p></dd>
        </dl>
        <dl>
            <dt><a href="star.asp?leibie=hua" ><img src="image/hua.png"></a></dt>
            <dd><p>花:<span>
            <%=readcounter("\www\asp_text\application\hua.txt") %></span>票</p></dd>
        </dl>
        <dl>
            <dt><a href="star.asp?leibie=hudie" ><img src="image/hudie.png"></a></dt>
            <dd><p>蝴蝶:<span>
            <%=readcounter("\www\asp_text\application\hudie.txt")%></span>票</p></dd>
        </dl>
        <dl>
            <dt><a href="star.asp?leibie=jita" ><img src="image/jita.png"></a></dt>
            <dd><p>吉他:<span>
            <%=readcounter("\www\asp_text\application\jita.txt")%></span>票</p></dd>
        </dl>
    </div>
</body>
</html>

搜索更多相关主题的帖子: function nothing counter 网页 
2012-11-13 22:58
dzt0001
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:5
帖 子:1281
专家分:4998
注 册:2005-10-12
得分:20 
else if request("leibie")="xin" then 这句的else if改为elseif
掌握好语法,写代码要细心

----我怎能在别人的苦难面前转过脸去----
2012-11-14 10:41
cartaion
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2012-11-5
得分:0 
知道了,以后一定细心!
2012-11-14 13:28



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-386975-1-1.html




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

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