''总提示这一行缺少end,我就没发现

wenhao676 2002-09-11 01:10:37
<%
function FunSql()
'****************************************************************************************************
'ÐÂÎÅÁбíÄ£¿é - 2
'----------------------------------------------------------------------------------------------------
If news_content_show_type="" Then 'ÏÔʾȫ²¿ÐÂÎÅ
content_sql="select * from [News-Content] order by News_date desc"
now_wz="È«²¿ÐÂÎÅÁбí"
now_wz_link="list.asp?type="
ElseIf news_content_show_type="sea" Then 'ÏÔʾËÑË÷ÄÚÈÝ
My_search_key=Trim(request.form("news_key"))
My_search_type=Trim(request.form("news_type"))
If My_search_type="title" Then
My_search_type="News_title"
ElseIf My_search_type="content" Then
My_search_type="News_content"
Else
My_search_type="all"
End If
If My_search_key<>"" and My_search_type<>"" Then
If My_search_type="all" Then
content_sql="select * from [News-Content] where News_title like '%"&My_search_key&"%' or News_content like '%"&My_search_key&"%' order by News_date desc"
Else
content_sql="select * from [News-Content] where "&My_search_type&" like '%"&My_search_key&"%' order by News_date desc"
End If
ElseIf My_search_key<>"" And My_search_type="" Then
content_sql="select * from [News-Content] where News_title like '%"&My_search_key&"%' or News_content like '%"&My_search_key&"%' order by News_date desc"
Else
content_sql="select * from [News-Content] order by News_date desc"
End If
now_wz="ÐÂÎÅËÑË÷Áбí"
now_wz_link="list.asp?type=sea&key="&My_search_key&"type="&My_search_type
%>
<%
ElseIf news_content_show_type="sort" Then 'ÏÔʾÀ¸Ä¿ÐÂÎÅ
My_sort_id=Trim(request("sort"))
If My_sort_id<>1 Then
If My_sort_id=2 Then
content_sql="select * from [News-Content] where News_sort <> 1 order by News_date desc" 'ÒòΪУÍâÐÂÎÅ°üº¬¶àÖÖÀ¸Ä¿
Else
content_sql="select * from [News-Content] where News_sort = "&My_sort_id&" order by News_date desc" 'УÍâ¸÷À¸ÐÂÎÅ
End If
Else
content_sql="select * from [News-Content] where News_sort = 1 order by News_date desc" 'УÄÚÐÂÎÅ
End If
ElseIf news_content_show_type="call" Then 'ÏÔʾÈÈÃÅÐÂÎÅ
content_sql="select * from [News-Content] where News_call<>'' order by News_call desc"
ElseIf news_content_show_type="signify" Then 'ÏÔʾÖصãÐÂÎÅ
content_sql="select * from [News-Content] where News_signifysign=1 order by News_date desc"
ElseIf news_content_show_type="bulletin" Then 'ÏÔʾ¹«¸æÐÂÎÅ
content_sql="select * from [News-Content] where News_bulletinsign=1 order by News_date desc"
Else 'ÏÔʾȫ²¿ÐÂÎÅ
content_sql="select * from [News-Content] order by News_date desc"
now_wz="È«²¿ÐÂÎÅÁбí"
now_wz_link="list.asp?type="
End If
recordset.Open content_sql,conn,1,1
''总提示这一行缺少end,我就没发现
end function
%>
...全文
205 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wenhao676 2002-09-11
  • 打赏
  • 举报
回复
不对 后面还有elseif
zyhowe 2002-09-11
  • 打赏
  • 举报
回复
If My_search_type="title" Then
My_search_type="News_title"
ElseIf My_search_type="content" Then
My_search_type="News_content"
Else
My_search_type="all"
End If

...加一个end if
wenhao676 2002-09-11
  • 打赏
  • 举报
回复
<%
function FunSql()
'****************************************************************************************************
'新闻列表模块 - 2
'----------------------------------------------------------------------------------------------------
If news_content_show_type="" Then '显示全部新闻
content_sql="select * from [News-Content] order by News_date desc"
now_wz="全部新闻列表"
now_wz_link="list.asp?type="
ElseIf news_content_show_type="sea" Then '显示搜索内容
My_search_key=Trim(request.form("news_key"))
My_search_type=Trim(request.form("news_type"))
If My_search_type="title" Then
My_search_type="News_title"
ElseIf My_search_type="content" Then
My_search_type="News_content"
Else
My_search_type="all"
End If
If My_search_key<>"" and My_search_type<>"" Then
If My_search_type="all" Then
content_sql="select * from [News-Content] where News_title like '%"&My_search_key&"%' or News_content like '%"&My_search_key&"%' order by News_date desc"
Else
content_sql="select * from [News-Content] where "&My_search_type&" like '%"&My_search_key&"%' order by News_date desc"
End If
ElseIf My_search_key<>"" And My_search_type="" Then
content_sql="select * from [News-Content] where News_title like '%"&My_search_key&"%' or News_content like '%"&My_search_key&"%' order by News_date desc"
Else
content_sql="select * from [News-Content] order by News_date desc"
End If
now_wz="新闻搜索列表"
now_wz_link="list.asp?type=sea&key="&My_search_key&"type="&My_search_type
%>
<%
ElseIf news_content_show_type="sort" Then '显示栏目新闻
My_sort_id=Trim(request("sort"))
If My_sort_id<>1 Then
If My_sort_id=2 Then
content_sql="select * from [News-Content] where News_sort <> 1 order by News_date desc" '因为校外新闻包含多种栏目
Else
content_sql="select * from [News-Content] where News_sort = "&My_sort_id&" order by News_date desc" '校外各栏新闻
End If
Else
content_sql="select * from [News-Content] where News_sort = 1 order by News_date desc" '校内新闻
End If
ElseIf news_content_show_type="call" Then '显示热门新闻
content_sql="select * from [News-Content] where News_call<>'' order by News_call desc"
ElseIf news_content_show_type="signify" Then '显示重点新闻
content_sql="select * from [News-Content] where News_signifysign=1 order by News_date desc"
ElseIf news_content_show_type="bulletin" Then '显示公告新闻
content_sql="select * from [News-Content] where News_bulletinsign=1 order by News_date desc"
Else '显示全部新闻
content_sql="select * from [News-Content] order by News_date desc"
now_wz="全部新闻列表"
now_wz_link="list.asp?type="
End If
recordset.Open content_sql,conn,1,1

end function
%>
cshadow 2002-09-11
  • 打赏
  • 举报
回复
你的if语句写得不规范
iStringTheory 2002-09-11
  • 打赏
  • 举报
回复
怎么很多是乱码?重贴一次

28,391

社区成员

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

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