日期:2014-05-16  浏览次数:21034 次

if elseif判断不起作用语句求助
本帖最后由 mycilent 于 2012-11-30 17:54:08 编辑
求助,高手们帮看下这代码有啥问题

act=request.QueryString("act")
if act="news" then
fn="news"
elseif act="soft" then
fn="soft"
else
fn="other"
end if

if currentPage=1 then
file=fn
else
file=fn&"_"&currentPage
end if
如访问:http://bbs.csdn.net/?act=news后得到的结果都是fn="other"这个结果。
不管act=news或者act="soft"。 fn的值都是other,前面2个判断起不到作用。不知道是怎么回事。

------解决方案--------------------
代码没有问题哦。能判断出获取到什么值。

------解决方案--------------------
不关
if 
elseif
的事
------解决方案--------------------
trim一下腰比较的变量。有可能有空格的问题。
------解决方案--------------------
恩,空格?或者大小写?