日期:2014-05-17  浏览次数:21013 次

Server.UrlEncode 编码传值?请帮忙解决,谢谢
<%
if   Request( "action ")= "sss "   then
text=Request.querystring( "text ")
Response.Write   text
Response.End
end   if
%>
<form   id= "form1 "   name= "form1 "   method= "post ">
    <input   type= "text "   name= "text "   />
<input   name= "button "   type= "button "   value= "提交 "  
onClick= "location.href= '122222.asp?action=sss&text= <%=Server.UrlEncode   ()%> '+document.form1.text.value+ ' ' ">   </form>


------解决方案--------------------
<form id= "form1 " name= "form1 " method= "post " action= " ">
改:
<input name= "button " type= "button " value= "提交 "
onClick= "location.href= '122222.asp?action=sss&text= <%=Server.UrlEncode ()%> '+document.form1.text.value+ ' ' ">  为:
<input name= "button " type= "button " value= "提交 "
onClick= "document.form1.action= '122222.asp?action=sss&text= '+escape(document.form1.text.value)+ ' ' ">  

你要直接改就用escape()