Asp classic 经典ASP中的动态变量

Asp classic 经典ASP中的动态变量,asp-classic,Asp Classic,我想知道链接中动态变量的确切代码是什么,并通过If和If-else条件进行设置 假设我有default.asp?variable=value&string=number的链接 我怎样才能把它输入到我的页面中,并用条件术语进行编码呢。不确定我的代码是否正确 <% DIM value = something If blah-blah then [asp code here] else if blah-blah then [another asp code here] end if %>

我想知道链接中动态变量的确切代码是什么,并通过If和If-else条件进行设置

假设我有default.asp?variable=value&string=number的链接

我怎样才能把它输入到我的页面中,并用条件术语进行编码呢。不确定我的代码是否正确

<%
DIM value = something
If blah-blah then
 [asp code here]
else if blah-blah then
 [another asp code here]
end if
%>
我必须在If和Else If上匹配一个动态值,诸如此类。
提前感谢…

我假设您的问题是关于ASP classic的,您将处理:

default.asp?cmd=add&x=5&y=4 默认值。asp?cmd=mult&x=5&y=4 并且,您希望输出分别为

答案是9 答案是20 这方面的ASP类似于:

<html>
<head>
<title>simple asp</title>
</head>
<body>
<%
Dim cmd, x, y
cmd = Request.QueryString("cmd")
x = CDbl(Request.QueryString("x"))
y = CDbl(Request.QueryString("y"))
Select Case cmd
Case "add"
  Response.Write("Answer is " & (x + y))
Case "mult"
  Response.Write("Answer is " & (x * y))
Case Else
  Response.Write("Please supply a valid cmd")
End Select
%>
</body>
</html>

我假设您的问题是关于ASP classic的,您将处理:

default.asp?cmd=add&x=5&y=4 默认值。asp?cmd=mult&x=5&y=4 并且,您希望输出分别为

答案是9 答案是20 这方面的ASP类似于:

<html>
<head>
<title>simple asp</title>
</head>
<body>
<%
Dim cmd, x, y
cmd = Request.QueryString("cmd")
x = CDbl(Request.QueryString("x"))
y = CDbl(Request.QueryString("y"))
Select Case cmd
Case "add"
  Response.Write("Answer is " & (x + y))
Case "mult"
  Response.Write("Answer is " & (x * y))
Case Else
  Response.Write("Please supply a valid cmd")
End Select
%>
</body>
</html>

从这一行代码中获得想法

<%
Set udrmcatgry=TheDB.Execute("SELECT * FROM rmcatgry ORDER BY sl asc")
Do while Not udrmcatgry.eof=true 
myqsl=udrmcatgry("sl")
TheDB.Execute "Update `rmcatgry` set   catnme`='"&request.form(""+myqsl+"")&"' where sl='"&myqsl&"' "
udrmcatgry.MoveNext         
Loop
%>

从这一行代码中获得想法

<%
Set udrmcatgry=TheDB.Execute("SELECT * FROM rmcatgry ORDER BY sl asc")
Do while Not udrmcatgry.eof=true 
myqsl=udrmcatgry("sl")
TheDB.Execute "Update `rmcatgry` set   catnme`='"&request.form(""+myqsl+"")&"' where sl='"&myqsl&"' "
udrmcatgry.MoveNext         
Loop
%>

您的描述是php,但您的问题标题和标记表示asp classic,它是哪一个?编辑:我可能误解了你的实际意图!是的,很抱歉,我忽略了。呃。。。你到底想让它做什么?你的描述是php,但你的问题标题和标签是asp classic,它是哪一个?编辑:我可能误解了你的实际意图!是的,很抱歉,我忽略了。呃。。。你到底想让它做什么?