asp中用VBscripy写过程出现了问题
各位好:
我在asp页面里写了过程结果出现了500错误,请帮忙看看,谢谢!
过程如下:sub changeps,changeschool,changeurl
<html> <head>
<title> 用户信息修改 </title>
<style type= "text/css ">
<!--
a:link {text-decoration: underline none;color:#000077}
a:visited { text-decoration: underline none; color:#000077}
A:hover {text-decoration: underline none; color:#CC0000 }
td { font-size: 12px}
body { font-size: 12x ;color=#333333}
.hand {cursor : hand ; text-decoration: underline}
//-->
</style>
</head>
<body bgcolor= "#FFFBFF " topmargin= "0 " leftmargin= "0 ">
<!--#include file= "DAO3/INC/d3_condb1.inc "-->
<%
code_sql1= "select * from inform where username= ' "&session( "theuser ")& " ' "
set rs1=conn.execute(code_sql1)
code_sql2= "select * from schoolurl where id= ' "&mid(session( "theuser "),5,3)& " ' "
set rs2=conn.execute(code_sql2)
sub changeps(username as string,newpassword as string)
msql= "update inform set password= ' " & newpassword & " ' where username= ' " & username & " ' "
conn.execute(msql)
end sub
sub changeschool(id as string,newname as string)
msql= "update schoolurl set school= ' " & newname & " ' where id= ' " & mid(session( "theuser "),5,3) & " ' "
conn.execute(msql)
end sub
sub changeurl(id as string,newurl as string)
msql= "update schoolurl set url= ' " & newurl & " ' where id= ' " & mid(session( "theuser "),5,3) & " ' "
conn.execute(msql)
end sub
%>
<div align= "center ">
<center>
<table border= "0 " cellpadding= "0 " cellspacing= "0 " width= "778 " height= "100% ">
<tr>
<td colspan= "3 " height= "86 ">
<!--#include file= "inc/head.inc "-->
</td>
</tr>
<tr>
<td width= "150 " align= "center " valign= "top ">
<!--#include file= "inc/left.inc "-->
</td>
<td width= "1 " bgcolor= "#458D8D "> </td>
<td width= "627 " valign= "top ">
<div align= "center ">
<table border= "0 " cellpadding= "0 " cellspacing= "0 " width= "90% ">
<tr>
<td width= "100% "> </td>
</tr>
<tr>
<td height= "30 " colspan= "2 " valign= "top ">
<!--管理员查询留言功能begin-->
<%
'sub changeps(username as string,newpassword as string)
'msql= "update inform set password= ' " & newpassword & " ' where username= ' " & username & " ' "
'conn.execute(msql)
'end sub
'sub changeschool(id as string,newname as string)
'msql= "update schoolurl set school= ' " & newname & " ' where id= ' " & mid(session( "theuser "),5,3) & " ' "
'conn.execute(msql)
'end sub
'sub changeurl(id as string,newurl as string)
'msql= "update schoolurl set url= ' " & newurl & " ' where id= ' " & mid(session( "theuser "),5,3) & " ' "
'conn.execute(msql)
'end sub
%>
<p> 一、 <b> 更改密码 </b> <br>
用户名称: <%=session( "theuser ")%> </p>
<p> 用户密码
<input name= "password " type= "text " id= "password " onSelect= "this.focus() " onMouseOver= "this.select() "value= <%=rs1( "pass ")%> >
<input name= "mima " type= "submit " id= "mima " onClick= "changeps(session( "theuser "),password.value) " value= "修改密码 ">
</p>
<form action=changeschool(mid(session( "theuser "),5,3),schoolname.value) method= "post " name= "form1 ">
<p> 二、 <b> 修改学校名称 <br>
<input name= "schoolname " type= "text " id= "schoolname " onSelect= "this.focus() " onMouseOver= "this.select() " value= <%=rs2( "school ")%> >
</b>
<input name= "mingcheng " type= "submit " id= "mingcheng " value= "修改名称 ">
</p>
<p> </p>
</form>
<!--管理员查询留言功能end-->
<p> 三、 <strong> 修改学校介绍url </strong> </p>
<p> <b>
<input name= "url " type= "text " id= "url " onSelect= "this.focus() " onMouseOver= "this.select() " maxlength= "254 " value= <%=rs2( "url ")%> >
</b>
<input name= "murl " type= "submit " id= "murl " onClick= "changeurl(mid(session( "theuser "),5,3),url.value) " value= "修改url ">
</p>
<p> </p>
<p> </p>
<p> </p>
</table>
</div>
</td>
</tr>
<tr>
<td width= "778 " align= "center " colspan= "3 "> <!--#include file= "inc/tail.inc "--> </td>
</tr>
</table>
</center>
</div>
</body>
</html>
[解决办法]
sub changeurl(id as string,newurl as string)
把类似id as string后面的as string 去掉
vbscript只有一种数据类型