注册 登录
编程论坛 ASP技术论坛

IF语句错误,请教

wugang901 发布于 2012-03-21 13:26, 350 次点击
语法错误
/index.asp, line 11
elseif time<#19:00:00# and time>=#12:00:00# then strgreeting = "下午好!welcome"



源代码
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>插入ASP代码</title>
</head>
<body bgcolor="#00CCFF">
<%
if time<#12:00:00# and time>=#00:00:00# then strgreeting = "上午好!welcome"
elseif time<#19:00:00# and time>=#12:00:00# then strgreeting = "下午好!welcome"
end if

%>
<%= strgreeting %>


<body>

</body>
</html>
2 回复
#2
wangjy5002012-03-21 21:16
#号去掉看看。
#3
yms1232012-03-21 21:39
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>插入ASP代码</title>
</head>
<body bgcolor="#00CCFF">
<%
if Hour(Now)<12 and Hour(Now)>=0 then strgreeting = "上午好!welcome"
elseif Hour(Now)<19 and Hour(Now)>=12 then strgreeting = "下午好!welcome"
end if

%>
<%= strgreeting %>
1