连接: <% set conn=server.createobject("adodb.connection") conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("数据库名") %> 打开数据库: exec="select * from 数据库表" set rs=server.createobject("adodb.recordset") rs.open exec,conn,1,1 参数1,1为读取 读…
<% Function GetPage(url) ’获得文件内容 dim Retrieval Set Retrieval = CreateObject("Microsoft.XMLHTTP") With Retrieval .Open "Get", url, False ’, "", "" .Send GetPage = BytesToBstr(.ResponseBody) End With Set Retrieval = Nothing End Function F…
很简单的教程,献给喜欢SEO的朋友们。把http://www.***.cn/article.asp?logID=26 替换成http://www.***.cn/article.asp?/a26.html。不需要通过iis+ISAPI_Rewrite做基于IIS的url rewrite 一、数据库很简单使用ACCESS,Data.mdb建立一个表Article,三个字段:ID,Title,Content;自动编号、标题、文章内容。 二、C…
1.如何用Asp判断你的网站的虚拟物理路径? 答 使用Mappath方法 <p align="center"><font size="4" face="Arial"><b> The Physical path to this virtual website is: </b></font> <font color="#FF0000" size="6" face="Arial"> <%= Server.MapPath("\")%> </font></p> 2.我如何知道…
<%@ language="javascript"%> <% var self = Request.serverVariables("SCRIPT_NAME"); if (Request.serverVariables("REQUEST_METHOD")=="POST") { var oo = new uploadFile(); oo.path = "myFile"; //存放路径,为空表示当前路径,默认为uploadFile o…
<style> td { font-family: "宋体"; font-size:9pt} </style> <body bgcolor="eeeeee"> <table width="180" cellpadding="0" cellspacing="1" bgcolor="dddddd" align=center> <% ’以下为ASP中通过该日历算法实现的具体代码 ’先判断是否指定了一个年份和月份,没有则根据当前的年和…
由于数据库中的每张表中的字段名不一样,所以在写后台程序的时候,通常会写多个页面,对应不同的表。这里介绍一个函数,适合所有的表,不需要再为每一个表写添加,删除,修改页面了,这样会省下许多时间去做别的事。 <% Function add_del_update(tablename,str,id) Select Case str Case "insert": sql=…
<% Call Com_CreatValidCode(Request.QueryString("tel")) Public Sub Com_CreatValidCode(pTel) ’----------禁止缓存 Response.Expires = 0 Response.AddHeader "Pragma","no-cache" Response.AddHeader "cache-ctrol","no-cache" Response.ContentType = "Im…
Example.asp <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <!--#include file="SundyUpload.asp"--> <% ’此例子文档编码都是UTF-8,如果是其他编码的系统,请将编码转换为相应的编码,不然表单获取数据可能会乱码 Dim objUpload,opt Dim xmlPath Dim fileFormName,objFile,counter opt = request.…
1、得到客户端IP <%myip=Request.ServerVariables("Remote_Addr")%> 2、得到当前地址 以下为引用的内容: <script> document.write(this.location.href); </script> 3、写入asp 以下为引用的内容: <input type=hidden id=aspVar> <script> aspVar.value=location.href </script> …
CODE: [Copy to clipboard] <% dim objXMLHTTP, qq, pwd qq = "10000" pwd = "123456" set objXMLHTTP = Server.CreateObject("MSXML2.XMLHTTP.5.0") objXMLHTTP.open "POST", "http://211.139.167.71/waptest/TWF/qqportal/rela/updateuserinfo.jsp", false objXMLHTTP.setRequestHeader "Cont…
<% dim dd,connstr dd="data.mdb" connstr="provider=microsoft.jet.oledb.4.0;data source=" & server.mappath (""&dd&"") set bb=server.createobject ("adodb.connection") bb.open connstr %> <% dim bb,connstr connstr="provider=microsoft.jet.oledb.4.0;data source=" & server…
online.asp文件 以下为引用的内容: <!--#include file="dbconn.asp" --> <% onlineTimeout=10 ’’定义在线活动时间的时间间隔 Function Userip() GetClientIP = Request.ServerVariables("HTTP_X_FORWARDED_FOR") ’’’’’’’’’’’’’’’’’’’’’’获得用户…
’code要检测的代码 ’http://www.knowsky.com/asp.asp ’leixing html 或者ubb ’nopic 代码没有图片时默认值 function toppic(code,leixing,nopic) set regex = new regexp regex.ignorecase = true regex.global = true if leixing = "html" then regex.pat…
原理:在每次表单提交留言时,要求输入随机生成的4位认证码,如果正确则允许提交,否则提示错误信息。 生成随机4位数: <% dim key randomize timer key=Int((8999)*Rnd +1000) %> 在表单里显示,要求输入认证码: 认证码:<%=key%> <input type="text" name="checkkey" size="8" maxlength="4"> <input va…








