请你们帮我看看问题在哪里(在线等)60分

shaolin45 2004-08-30 05:26:22
<%@ language="JScript"%>
<%
var colors=new Array("black","red","lime","blue",
"magenta","yellow","cyan","teal","olive","punple",
"navy","green","maroon","gray","silver");

function isSet(val)
{
var tf=ture;
if(var=="undefined"||var==null||var=="")
{
tf=false;
}
return tf;
}
function isUnique(username)
{
return !isSet(Application(username));
}
function getNextID()
{
var id=Application("nextID");
if(isSet(id)==false)
{
id=1;
}
Application("nextID")=id+1;
return id;
}
function handleError(message)
{
Response.Clear();
Response.Write(message);
Response.End();
}
if(isSet(Session("username")))
{
Response.Redirect("post.asp");
}
var username=Request.Form("uesrname")+"";

if(isSet(username)==false)
{
handleError("Username must not be empty!");
}
Application.Lock();
if(isUnique(username))
{
var id=getNextID();
var index=id%colors.length;
Session("uesrname")=username;
Application(username)=colors[index];
}
else
{
Application.UnLock();
handleError("The username:""+username+""is in use,please choose a
different one.");
}
Application.UnLock();
Response.Redirect("post.asp");
%>

错误提示:
Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

Microsoft JScript 编译错误 错误 '800a03ea'

语法错误

/mysite/TMPex44d34qtb.asp,行10

if(var=="undefined"||var==null||var=="")
---^
...全文
60 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
shaolin45 2004-08-30
  • 打赏
  • 举报
回复
哎。。真是粗心。。这不是把“true”写成“ture”了。。能不能把“ mind_1220(大灰狼) ”
net_lover(孟子E章)二位的qq号码告诉我。我想向你们学习
shaolin45 2004-08-30
  • 打赏
  • 举报
回复
非常感谢各位。我刚刚也检查出来了。。
不过又出现一个问题:


Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

Microsoft JScript 运行时错误 错误 '800a1391'

'ture' 未定义

/mysite/TMPgmks134t0z.asp,行9
mind_1220 2004-08-30
  • 打赏
  • 举报
回复
if(var=="undefined"||var==null||var=="")

错误

应该是:
if(val=="undefined"||val==null||val=="")
孟子E章 2004-08-30
  • 打赏
  • 举报
回复
应该是这样的吧

function isSet(val)
{
var tf=ture;
if(val=="undefined"||val==null||val=="")
{
tf=false;
}
return tf;
}
孟子E章 2004-08-30
  • 打赏
  • 举报
回复
var是关键字,不要做变量!!!!

28,409

社区成员

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

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