我想知道链接的动态变量的确切代码是什么,并通过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,类似的东西。 提前谢谢......
答案 0 :(得分:4)
我将假设您的问题是关于ASP经典并且您将要处理:
并且,您希望输出
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>
答案 1 :(得分:1)
从这行代码中获取想法
<%
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
%>