晕~
代码是:if instr(url,"article")>0 then
Sql="select title from [sms] Where ID="&ID
elseif
Sql="select name from [wjfile] where soft=1"
elseif
Sql="select name from [wsfile] Where ID="&ID
elseif
Sql="select name from [wjfile] where picsc=2"
end if
这样加,应该没错啊!
怎么会错误呢?
晕~
大家能帮我解决一下嘛?
还有那里有asp if语句教程呢?我去也顺便去学习下!
有人说这样加才无错:
if instr(url,"article")>0 then
Sql="select title from [sms] Where ID="&ID
elseif
Sql="select name from [wjfile] where soft=1"
elseif
Sql="select name from [wsfile] Where ID="&ID
else
Sql="select name from [wjfile] where picsc=2"
end if
但还是提示:
Microsoft VBScript 编译器错误 错误 '800a03ea'
语法错误
/getbook.asp,行 40
elseif
------^
首先,你的类型如下:【文章】【软件】【音乐】【图片】【帖子】【网址】
为规范你的游标判断,约定条件如下:
【文章=article】【软件=software】【音乐=music】【图片=pic】【帖子=forum】【网址=weburl】
同时添加收藏时软件地址必须恒等以上条件。
if instr(url,"article")>0 then
Sql="select title from [sms] Where ID="&ID
elseif instr(url,"software")>0 then
Sql="select name from [wjfile] where soft=1 and ID="&ID
elseif instr(url,"music")>0 then
Sql="select name from [wsfile] Where music=1 and ID="&ID
elseif instr(url,"pic")>0 then
Sql="select name from [wjfile] where picsc=1 and ID="&ID
elseif instr(url,"forum")>0 then
Sql="select name from [wjfile] where forum=1 and ID="&ID
elseif instr(url,"weburl")>0 then
Sql="select name from [wjfile] where weburl=1 and ID="&ID
end if
【url=/article.asp-w-id-d-1-a-class-d-1】这个是文章收藏时所附加的url判断,其余模块也必须附件并修改,例如:
图片的:【url=/pic.asp-w-id-d-1-a-class-d-1】
软件的 【url=/software.asp-w-id-d-1-a-class-d-1】
if instr(url,"article")>0 then
Sql="select title from [sms] Where ID="&ID
elseif then
Sql="select name from [wjfile] where soft=1"
elseif then
Sql="select name from [wsfile] Where ID="&ID
elseif then
Sql="select name from [wjfile] where picsc=2"
end if
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息