当前位置: 首页 > 图文教程 > 网络编程 > ASP > 嘿,大家瞧瞧这老外在页面之间传递元素的办法

ASP
asp 实现对SQL注入危险字符进行重编码处理的函数
asp下实现对HTML代码进行转换的函数
asp 验证用户名是否包含有非常字符的函数
ASP通用分页样式函数代码
asp 生成任意英文+数字位数长度的随机码函数
asp 取得中文句子头一个字的大写拼音字母的函数
asp实现计算两个时间内的工作日的函数
asp实现过滤关键字的函数
asp实现限制搜索的关键字的函数
asp动态include文件,方便多模板的实现
推荐的用Asp实现屏蔽IP地址访问的代码
XDOWNPAGE ASP版本 分页类
飞云防CC攻击ASP程序代码插件
定期自动运行ASP程式的代码
ASP下Cookie操作的详细讲解
再发几个ASP不错的函数
比较不错的asp模板引终极讲解(WEB开发之ASP模式)
ip138之asp小偷程序代码
在VBScript中实现-函数/方法名作为参数传入另一个函数
asp实现批量插入表单中的数据到数据库的方法

ASP 中的 嘿,大家瞧瞧这老外在页面之间传递元素的办法


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 194 ::
收藏到网摘: n/a

       在第三方页面传递参数这个思路倒是的确可以省下一些代码,至少我以前是从没这样子传过。
  <%
   ''Pass form objects submitted by a form G
   '' ET
   If Request.QueryString.Count>0 Then
   QStr="?"
   For Each x In Request.QueryString
   QStr = QStr & x & "=" ''Write Name of Parameter
   QStr = QStr & Server.URLEncode(request.QueryString(x)) & "&" ''Write value of parameter
   Next
   QStrSz = len(QStr)-1
   QStr = LEFT(QStr,QStrSz)
   else
   QStr=""
   End If
   Response.Redirect("YourURL.asp" & QStr)
   %>
   The Next example shows how To build the submitted parameters from a form POST. The procedure reads all posted objects and builds a querystring parameter.
   <%
   ''Pass form objects submitted by a form G
   '' ET
   If Request.form.Count>0 Then
   QStr="?"
   For Each x In Request.form
   QStr = QStr & x & "=" ''Write Name of Parameter
   QStr = QStr & Server.URLEncode(request.form(x)) & "&" ''Write value of parameter
   Next
   QStrSz = len(QStr)-1
   QStr = LEFT(QStr,QStrSz)
   else
   QStr=""
   End If
   Response.Redirect("YourURL.asp" & QStr)
   %>
   The Next code example may be used as a test ASP page To redirect to. It reads the querystring and builds a table to display the parameter name and value passed.
   <%@ Language=VBScript %>
   <HTML>
   <BODY>
   <%
   Response.Write "<TABLE BORDER=1><TR><TH>Parameter</TH><TH>Value</TH></TR>"
   For Each x In Request.QueryString
   Response.write "<TR><TD>" & x & "</TD><TD>" ''Write Name of Parameter
   Response.write Request.QueryString(x) & "</TD></TR>" ''Write value of parameter
   Next
   Response.Write "</TABLE>"
   %>
   </BODY>
   </HTML>
  当然,上面这个东西的改进版本就简洁多了,再看这个
  <%
  If
  Request.QueryString.Count > 0 Then
  
  Response.Redirect("YourURL.asp?" &
  Request.QueryString
  Else
   If
  Request.Form.Count > 0 Then
  
  Response.Redirect("YourURL.asp?" &
  Request.Form)
   Else
  
  Response.Write("No Data Sent")
   End
  If
  End If
  %>
  原来可以整个抓取的,我也是刚刚知道,不敢独吞,拿出来共享