我最近刚接触ASP,我似乎无法让它工作
<html>
<body>
<form action="test.asp" method="post">
<input type="text" name="text" />
<input type="submit" value="submit" />
</form>
<%
dim x
x=Request.Form("text")
Responce.Write(x)
%>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
显示文本框和提交按钮但是显示此错误并且此ASP不起作用.我不确定我的代码或IIS是否有问题.任何有关这方面的帮助将非常感激
An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click here to find out more about this error.
Run Code Online (Sandbox Code Playgroud) asp - > odbc - > mysql,多查询问题.
dbCon.execute("update wp_posts set post_abc = '1234' where ID=1602';");: 没问题
dbCon.execute("set @aa=1602;update wp_posts set post_abc = '1234' where ID=@aa;");:错误
错误的消息:
[MySQL] [ODBC 5.2(w)驱动程序] [mysqld-5.1.45p1-log] SQL语法中有错误; 检查与您的MySQL服务器版本对应的手册,以便在'update wp_posts ........附近使用正确的语法.
我怎样才能解决这个问题?SOS !!!
不喜欢的答案:
dbCon.execute("set @aa=1602;");
dbCon.execute("update wp_posts set post_abc = '1234' where ID=@aa;");
Run Code Online (Sandbox Code Playgroud) 我需要一个函数来使用经典的 asp 来检查字符串是否全部(或大部分)大写。(我需要防止用户使用全部大写输入标题。)
例如,如果一个由 30 个字母组成的字符串包含 20 个或更多大写字母,我需要将其标记为“全部大写”。所以《基督山伯爵》可以,但《基督山伯爵》不行。
我正在考虑从匹配的字母开始[^A-Z],但我该怎么做呢?
这需要使用经典 ASP 而不是 VB。
我有一个简单VBScript的从数据库获取数据并迭代它们并生成一个表.在此迭代期间,我想捕获一些数据(特定列的值)并将它们保存在变量中供以后使用.但是每当我的代码到达那个if语句时,它就不再循环了.
Dim lats
Dim longs
Set lats = CreateObject("System.Collections.ArrayList")
Set longs = CreateObject("System.Collections.ArrayList")
%>
<table>
<tr><th>Office</th><th>Address</th><th>Comune</th><th>Province</th><th>Lat</th><th>Long</th><th>2G</th><th>3G</th><th>4G</th></tr>
<%do until rs.EOF
response.write("<tr>")
for each x in rs.Fields
response.write("<td>" & response.write(x.value) &"</td>")
'IF the below statement equals true, the loop doesn't perform anymore
If x.name = "SITE_LAT_N" Then
lats.Add x.value
ElseIf x.name = "SITE_LON_E" Then
longs(indx) = x.value
End If
next
rs.MoveNext
response.write("</tr>")
loop
rs.close
conn.close
%>
</table>
Run Code Online (Sandbox Code Playgroud) 我们使用经典 ASP 通过 Response.Cookies(" CookieName ")构建我们的 cookie 。我们如何将“SameSite”设置为“none”?
我正在处理遗留代码,其中包含另一个ASP页面.
<!--#INCLUDE virtual="/PAGE1.ASP"-->
Run Code Online (Sandbox Code Playgroud)
从该页面获取一个变量,比如x,我相信我会这样做:
x = Request.Form("x")
Run Code Online (Sandbox Code Playgroud)
那是对的吗?
此外,对于经典.ASP文件,变量名称是否区分大小写?
非常感谢.
variables error-handling webpage parameter-passing asp-classic
我用C,Pascal,GWBasic,TCL,Perl,Lisp编程,但Visual Basic对我来说太先进了.
FOR j = 1 TO 31
output_to_webpage "<p>Counter is " + j + "</p>"
myDay = "" + j
IF j < 10 THEN myDay = "0" + j
MyStr = MyStr + ",j"
NEXT
Run Code Online (Sandbox Code Playgroud)
循环永远不会发生.虽然如果我注释掉对循环变量的任何引用j,它似乎循环.
我怎样才能真正实现Visual Basic循环.或错误.没有默默地假装那里根本没有FOR循环?
更新:如果循环的第一个语句只是一个简单的调试语句,我希望它总是至少执行一次,即使循环的其余部分被中止.但是,正如下面所指出的,对循环变量使用算术会导致整个循环甚至不执行一次.甚至不是循环内的初始调试语句.我觉得很奇怪.
有没有办法通过不同的编程语言检查登录状态?现在我使用ajax在登录过程后同时启动的三个会话(同名).
现在,login.html表单在三个文件上处理:login.aspx,login.asp和login.php,但它似乎太慢而且很奇怪.我将同一家公司的三种不同服务合并为一种,在重新构建用户和mysql中的其他常用表后,一切似乎都运行良好,但我真的很害怕安全漏洞.
只是为了让你知道,我必须在任何ajax回调之前检查登录会话状态,所以如果用户正在使用通过Ajax调用PHP的ASP页面,可能是会话在ASP上仍处于活动状态,但是已过期php文件.
任何有效的方法一次检查所有?我也可以接受cookie解决方案,但如何让它在php,asp和.net之间可读?
当我运行脚本时,它说
Microsoft VBScript运行时错误'800a01f5'
非法分配:“ MAX_AGE”
/classic.asp,第8行
这是脚本:
response.Write(GetMaxAge())
Function GetMaxAge()
const MAX_AGE = 50
Dim iRtnValue
MAX_AGE = 45
iRtnValue = MAX_AGE
GetStudentAge = iRtnValue
End Function
Run Code Online (Sandbox Code Playgroud) 我已经创建了一个可以下载的演示文件,还有一个可以运行的页面.我需要做的是,所有的标签,只需要在区域中删除(BBCode [code])
更新:该代码不适用于多个BBCode标记.所以,如果有的话
[URL] [Site] [B]
或者其他任何东西,下面的脚本会破坏所有标签.并且不会正确处理页面.
这是演示页面的链接. http://www.cffcs.com/test/EE/Main.asp
这是下载.zip文件的链接.http://www.cffcs.com/test/EE/Request.zip
如果有人可以帮助我,我会非常感激.
使用了下面的代码,但是,我发现它打破了"[code"部分中没有涉及的所有其他内容.这是正在使用的内容,可以在上面的代码文件中找到.
Function ReplaceChar(strString)
strString = Reggex(strString, "\[code=(.*?)\](.*?)\[\/code\]", "<code class=""$1"">$2</code>")
ReplaceChar = strString
End Function
Function ProtectSQL(SQLString)
SQLString = SQLString
SQLString = Replace(SQLString, "'", "''") ' replace > with >
SQLString = Replace(SQLString, vblf,"<br>") ' replace vblf with <br /> (This is mainly used for Memo fields.
SQLString = Trim(SQLString)
ProtectSQL = SQLString
End Function
getText = ProtectSQL(request.form("Answers"))
bigString = ReplaceChar(getText)
'grab the left chunk of text starting to …Run Code Online (Sandbox Code Playgroud) 我花了一整天才弄清楚我的编码有什么问题.有人可以告诉我,为了使我的编码工作,我应该改变什么.谢谢你:)
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ConnectionString);
SqlCommand cmd = new SqlCommand("Insert into ExpTab (username,month,ex1,p1,ex2,p2,ex3,p3,ex4,p4,ex5,p5,ex6,p6,ex7,p7,ex8,p8,,p3,p4,p5,p6,p7,p8) Values (@name,@month1,@ex1s,@p1s,@ex2s,@p2s,@ex3s,@p3s,@ex4s,@p4s,@ex5s,@p5s,@ex6s,@p6s,@ex7s,@p7s,@ex8s,@p8s)", conn);
cmd.CommandType = CommandType.Text;
cmd.Parameters.AddWithValue("@name", Membership.GetUser().UserName);
cmd.Parameters.AddWithValue("@month1", Label1.Text);
cmd.Parameters.AddWithValue("@ex1s", Label18.Text);
cmd.Parameters.AddWithValue("@p1s", Label20.Text);
cmd.Parameters.AddWithValue("@ex2s", Label2.Text);
cmd.Parameters.AddWithValue("@p2s", Label21.Text);
cmd.Parameters.AddWithValue("@ex3s", Label3.Text);
cmd.Parameters.AddWithValue("@p3s", Label22.Text);
cmd.Parameters.AddWithValue("@ex4s", Label4.Text);
cmd.Parameters.AddWithValue("@p4s", Label23.Text);
cmd.Parameters.AddWithValue("@ex5s", Label5.Text);
cmd.Parameters.AddWithValue("@p5s", Label24.Text);
cmd.Parameters.AddWithValue("@ex6s", Label6.Text);
cmd.Parameters.AddWithValue("@p6s", Label25.Text);
cmd.Parameters.AddWithValue("@ex7s", Label7.Text);
cmd.Parameters.AddWithValue("@p7s", Label26.Text);
cmd.Parameters.AddWithValue("@ex8s", Label8.Text);
cmd.Parameters.AddWithValue("@p8s", Label27.Text);
conn.Open();
cmd.ExecuteNonQuery();
Run Code Online (Sandbox Code Playgroud)
我真的需要帮助:(
为了想要一个ASP Classic程序的人试图将PHP脚本转移到VB脚本而苦苦挣扎.
到底发生了什么事?
width = 1008
height = 1260
If width > height Then
response.write("I am confused")
End If
Run Code Online (Sandbox Code Playgroud)
产生结果;
I am confused
Run Code Online (Sandbox Code Playgroud)
宽度值来自
dimensions = Split(canvas_size,"x")
width = dimensions(0)
height = dimensions(1)
Run Code Online (Sandbox Code Playgroud)
当我把它们写到屏幕上时,那些是我得到的数字.