·您的位置: 首页 » 资源教程 » 编程开发 » ASP » 动态产生变量

动态产生变量

类别: ASP教程  评论数:0 总得分:0
<%
how_many=50
mycreate = request.querystring("create")
If mycreate = "" Then
%><TITLE>Dynamically Generate Variables</TITLE>
<BODY bgcolor="#FFFFFF">
<FORM method="post" action="dyn_gen_variables.asp?create=1">
<FONT face="Verdana, Arial, Helvetica, sans-serif" size="2"><B>Dynamically Generate
Variables </B><BR>
<BR>
Variable Name: </FONT>
<INPUT type="text" name="variablename">
<BR>
<FONT face="Verdana, Arial, Helvetica, sans-serif" size="2">Request Type: </FONT>
<INPUT type="radio" name="requesttype" value="querystring" checked>
<FONT face="Verdana, Arial, Helvetica, sans-serif" size="2">Querystring</FONT>
<INPUT type="radio" name="requesttype" value="form">
<FONT face="Verdana, Arial, Helvetica, sans-serif" size="2">Form </FONT><BR>
<BR>
<INPUT type="submit" name="Submit" value="Submit">
</FORM>
<%
else
%>
<TITLE>Dynamically Generate Variables - DONE</TITLE>
<FONT face="Verdana, Arial, Helvetica, sans-serif" size="2"><B>Dynamically Generate
Variables</B></FONT> - DONE<BR>
<BR>
<BR>
<%
variablename = request.form("variablename")
requesttype = request.form("requesttype")
mycounter = 0
Do While mycounter < how_many
myvaroutput = myvaroutput & variablename & mycounter & " = replace(request." & requesttype & "(" & chr
(34) & variablename & mycounter & chr(34) & "), " & chr(34) & "\'" &chr(34) & ", " &chr(34) & "\'\'" & chr
(34) & ")"
myvaroutput = myvaroutput & "<BR>"
myvaroutput2 = myvaroutput2 & variablename & mycounter & " = TRIM(" & variablename & mycounter & ")"
myvaroutput2 = myvaroutput2 & "<BR>"
mycounter = mycounter + 1
loop
response.write "<FONT face=\'arial\' size=\'2\'>"
response.write "\' Get VARIABLES AND REPLACE APOSTROPHES With Double APOSTROPHES<BR>"
response.write myvaroutput
response.write "<BR><BR>"
response.write "\' TRIM ALL TEH SPACES OUT OF THE VARIABLES<BR>"
response.write myvaroutput2
response.write "</FONT>"
%> <%
End If
%>
</BODY>
</HTML>
-= 资 源 教 程 =-
文 章 搜 索
关键词:
类型:
范围:
纯粹空间 softpure.com
Copyright © 2006-2008 暖阳制作 版权所有
QQ: 15242663 (拒绝闲聊)  Email: faisun@sina.com
 纯粹空间 - 韩国酷站|酷站欣赏|教程大全|资源下载|免费博客|美女壁纸|设计素材|技术论坛   Valid XHTML 1.0 Transitional
百度搜索 谷歌搜索 Alexa搜索 | 粤ICP备19116064号-1