代碼:不知道這個函數那里錯了,請幫忙解決,謝謝!
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<select name="menu1" size="3" onchange="MM_jumpMenu('nei1',this,0)">
<%
set rs2=server.CreateObject("adodb.recordset")
sql2="select * from renshi"
rs2.open sql2,conn,1,1
if not rs2.eof then
for i=1 to rs2.recordcount and not rs2.eof
%>
<option value=nei1.asp?id=<%=rs2("id")%>><%=rs2("name")%></option>
<%
rs2.movenext
if rs2.eof then exit for
next
else
response.Write("<option value='沒有用戶'>沒有用戶</option>")
end if
%>
</select>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<select name="menu1" size="3" onchange="MM_jumpMenu('nei1',this,0)">
<%
set rs2=server.CreateObject("adodb.recordset")
sql2="select * from renshi"
rs2.open sql2,conn,1,1
if not rs2.eof then
for i=1 to rs2.recordcount and not rs2.eof
%>
<option value=nei1.asp?id=<%=rs2("id")%>><%=rs2("name")%></option>
<%
rs2.movenext
if rs2.eof then exit for
next
else
response.Write("<option value='沒有用戶'>沒有用戶</option>")
end if
%>
</select>
按照
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
看来应该是一个window名称
<%@LANGUAGE="VBSCRIPT" CODEPAGE="950"%>
<!--#include file=inc/yan.asp-->
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={SQL Server};server=localhost;uid=sa;pwd=;database=twp"
function HTMLcode(fString)
if not isnull(fString) then
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
fString = Replace(fString, CHR(10), "<BR>")
fString = Replace(fString, CHR(32), " ")
HTMLcode = fString
end if
end function
response.Write("cheng gong lianjie ")
%>
<%
call case10
if request("post")=1 then
if request("username")=" " or request("userpwd")="" then
response.Write("<script language=javascript> " & "alert('用戶名或密碼不能為空!');"& "history.back()" & "</script>")
else
if request("user")=0 then
call wr1
else
call wr2
end if
end if
end if
function wr1
username=trim(replace(request("username"),"'",""))
userpwd =trim(replace(request("userpwd"),"'",""))
for i=1 to len(username)
user=mID(username,i,1)
if user=" " or user="%" or user="<" or user=">" or user="&" or user="|" then
response.Write " <script language=javascript>" & "alert('你的用戶含有非法字符,請重新輸入');" & "history.back()" & "</script>"
response.End
end if
next
for i=1 to len(userpwd)
pass=mID(userpwd,i,1)
if pass="" or pass="<" or pass=">" or pass="%" or pass="&" or pass="|" then
response.Write (" <script language=javascript>" & "alert('你輸入的密碼,含有非法字符,請重新輸入');" & "</script>")
response.End
end if
next
set rs1=server.CreateObject("adodb.recordset")
sql1="select * from db_people where username='"&request("username")&"'"
rs1.open sql1 ,conn,1,1
if not rs1.eof then
response.Write ("<script language=javascript>" & " alert('用戶已經存在') " & "history.back()" & " </script>")
end if
rs1.close
set rs=server.CreateObject("adodb.recordset")
sql= "select * from db_people"
rs.open sql,conn,1,3
rs.addnew
rs("username")=request("username")
rs("userpwd")=request("userpwd")
rs("shenhe")=request("userpwd")
rs("huiyi")=request("huiyi")
rs("gonggong")=request("gonggong")
rs("geren")=request("geren")
rs("huibao")=request("huibao")
rs("caigou")=request("caigou")
rs("kucun")=request("kucun")
rs("shangbao")=request("shangbao")
rs("caigoushen")=request("caigoushen")
rs("renshi")=request("renshi")
rs("name")=session("na")
rs("time")=now()
rs.update
rs.close
response.Write("<script language=javascript>" & "alert('添加成功')" & "</script>")
end function
function wr2
username=trim(replace(request("username"),"'",""))
userpwd=trim(replace(request("userpwd"),"'",""))
for i=1 to len(username)
user=mID(username,i,1)
if user="'" or user="%" or user="<" or user=">" or user="&" or user="|" then
response.Write "<script language=javascript>" & "alert('你輸入的用戶含有非法字符,請重新輸入')" & "history.back()" & "</script>"
response.End
end if
next
for i=1 to len(userpwd)
pass=mID(userpwd,i,1)
if pass="'" or pass="%" or pass="<" or pass=">" or pass="&" or pass="|" then
response.Write "<script language=javascript>" & "alert('你輸入的密碼含有非法字符,請重新輸入')" & "hirtory.back() " & "</script>"
response.End
end if
next
set rs1=server.CreateObject("adodb.recordset")
sql1= "select * from db_people where username='"&request("username")&"'"
rs1.open sql1 ,conn,1,1
if not rs1.eof then
response.Write("<script language=javascript>" & "alert('用戶已經存在');" & "history.back()" & "</script>")
response.End
end if
rs1.close
set rs=server.CreateObject("adodb.recordset")
sql="select * from users"
rs.open sql,conn,1,3
rs.addnew
rs("username")=request("username")
rs("userpwd")=request("userpwd")
rs("name")=session("na")
rs("chaoji")=1
rs("time")=now()
rs.update
rs.close
response.Write ("<script language=javascript>" & "alert('添加成功');" & "history.back()" & "</script>")
end function
%>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
<title>Untitled Document</title>
</head><body>
<form id="form1" name="form1" method="post" action="">
<div align="center"></div>
<table width="616" height="308" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#669900">
<tr>
<td width="69" height="22" bgcolor="#66CC99">用戶名:</td>
<td width="156" bgcolor="#66CC99"><label>
<input name="username" type="text" id="username" value="" />
</label></td>
<td width="180" bgcolor="#66CC99"><div align="right">密碼</div></td>
<td width="201" bgcolor="#66CC99"><label>
<input name="userpwd" type="text" id="userpwd" value="" />
</label></td>
</tr>
<tr>
<td>選擇員工:</td>
<td colspan="3"><label>
<select name="menu1" size="3" onchange="MM_jumpMenu('nei1',this,0)">
<%
set rs2=server.CreateObject("adodb.recordset")
sql2="select * from renshi"
rs2.open sql2,conn,1,1
if not rs2.eof then
for i=1 to rs2.recordcount and not rs2.eof
%>
<option value=nei1.asp?id=<%=rs2("id")%>><%=rs2("name")%></option>
<%
rs2.movenext
if rs2.eof then exit for
next
else
response.Write("<option value='沒有用戶'>沒有用戶</option>")
end if
%>
</select>
<iframe src="nei1.asp" name="nei" width="400" height="52" scrolling="yes" frameborder="0"></iframe>
</label></td>
</tr>
<tr>
<td height="132">權限:</td>
<td colspan="3" valign="top"><table width="540" height="144" border="0" align="center">
<tr>
<td width="103"><input name="user" type="radio" value="0" checked="checked" />
普通用戶 </td>
<td width="138"><input name="user" type="radio" value="1" />
超級用戶</td>
<td colspan="2"> </td>
</tr>
<tr>
<td height="39"><input name="shenhe" type="checkbox" id="shenhe" value="checkbox" />
批示功能 </td>
<td><input name="gonggong" type="checkbox" id="gonggong" value="checkbox" />
公共信息管理</td>
<td width="128"><input name="huiyi" type="checkbox" id="huiyi" value="checkbox" />
會議管理</td>
<td width="153"><input name="geren" type="checkbox" id="geren" value="checkbox" />
審核個人登記活動</td>
</tr>
<tr>
<td height="38"><input name="huibao" type="checkbox" id="huibao" value="checkbox" />
匯總功能 </td>
<td><input name="caigou" type="checkbox" id="caigou" value="checkbox" />
采購功能</td>
<td><input name="kucun" type="checkbox" id="kucun" value="checkbox" />
提報庫存功能</td>
<td><input name="shangbao" type="checkbox" id="shangbao" value="checkbox" />
下達、完成情況匯報</td>
</tr>
<tr>
<td height="28"><input name="caigoushen" type="checkbox" id="caigoushen" value="checkbox" />
采購計划審核</td>
<td><input name="renshi" type="checkbox" id="renshi" value="checkbox" />
人事添加員工</td>
<td> </td>
<td> </td>
</tr>
</table>
<label></label> </td>
</tr>
<tr>
<td colspan="4" bgcolor="#669966"><div align="center">
<label>
<input type="submit" name="Submit" value="提交" />
................
</label>
<label>
<input type="submit" name="Submit2" value="重置" />
</label>
</div></td>
</tr>
</table>
<p><br />
<br />
</p>
<p> </p>
</form>
</body>
</html>