asp连接mysql
以mysql5.1为例
先下载mysql-connector-odbc并安装
1、直接连接
conn.asp
<%
strconnection="driver={mysql odbc 5.1 driver};database=test1;server=localhost;uid=root;password=root"
set conn = server.createobject("adodb.connection")
conn.open strconnection
%>
2、DSN连接
需要先在数据源 (ODBC)里的“系统DSN”中添加DSN“AAa”,在“用户DSN”中添加不一定能连接上!
<%
strConnection = "dsn=AAa;"
set conn = server.createobject("adodb.connection")
conn.open strconnection
%>
相关文档:
<head runat="server">
<title></title>
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
<script language="JavaScript"> ......
1.放注入函数
sub aspsql()
SQL_injdata = "'|;|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare"
SQL_inj = split(SQL_Injdata,"|")
If Request.Form<>"" Then
For Each Sql_Post In Request.Form
For SQL_Data=0 To Ubound(SQL_inj)
if instr(Request.Form(Sql_Post) ......
<%
'asp多风格分页类
'使用范例
'==========================================================================
'Set test = New Page '创建啦
'test.CurrentPage=1 '自己去读取拉,当前的页数
'test.temp="{N1}{N2}{N3} {N4}"'这里是显示的模版,自己可以定义,至于标签,可以自己去那个类里找
'test.Exec "S ......
1.html代码 formname是表单name,editname是文件域name,uppath是上传文件保存路径.
<input name="qtxx" type="text" id="qtxx" size="50" />
<input type="button" name="Submit22" value="上传图片" onClick="window.open('upload.asp?formname=from1&editname=qtxx&uppath ......
sub aspsql()
SQL_injdata = "'|;|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare"
SQL_inj = split(SQL_Injdata,"|")
If Request.Form<>"" Then
For Each Sql_Post In Request.Form
For SQL_Data=0 To Ubound(SQL_inj)
if instr(Request.Form(Sql_Post),Sql_Inj ......