请教高手改成response.write "格式的代码

来源:百度知道 编辑:UC知道 时间:2024/07/07 23:33:21
<script language="JavaScript">
function checkform(){
if (document.loginbox.userid.value.length ==0){
alert("出错了,您没有填写用户名。");
document.loginbox.userid.focus();
return false;
}
if (document.loginbox.password.value.length==0){
alert("出错了,您没有填写密码。");
document.loginbox.password.focus();
return false;
}
return true;
}
</script>

请教高手将以上代码改写成response.write "的格式!谢谢了

response.write("<script language="JavaScript">
function checkform(){
if (document.loginbox.userid.value.length ==0){
alert("出错了,您没有填写用户名。");
document.loginbox.userid.focus();
return false;
}
if (document.loginbox.password.value.length==0){
alert("出错了,您没有填写密码。");
document.loginbox.password.focus();
return false;
}
return true;
}
</script>
");这样就可以了,反正在.NET中是可以的,不知道你用什么工具开发的?

如Loadinger所说,如果单纯这样写的话,的确有漏洞,但在这里我不可能写上防sql注入的代码,再说,这些代码一般放在一个包含文件里面,不会每一个页面都要写。具体的安全事项还有有本人来完成吧。这就是另一回事了。
dim uid, pwd
uid=trim(request.form("userid"))
pwd=trim(request.form("password"))
if uid="" or pwd="" then
response.write("没有填写用户名或者密码")
response.end()
end if

加工下吧。。。楼上的,典型的误导人家。。。SQL注入就是这样出来的。。。。

with response
.write "<script language=""Java