ASP Perfect SQL anti-injection instance program

Dim Query_badword,form_badword,i,err_message,err_web,name '------Define partial head---------------------------------------------------------------------- Err_message = 1 ' processing mode: 1 = hint information, 2 = Turn page, 3 = prompt before

ASP authentication use method and verification Code program

If Request.QueryString ("action") thenOption ExplicitResponse.buffer=trueNumcodeDim znumFunction Numcode ()Response.Expires =-1Response.AddHeader "Pragma", "No-cache"Response.AddHeader "Cache-ctrol", "No-cache"Dim znum,i,jDim ados,ados1Randomize

ASP hidden download address and anti-theft chain code

Strfilename=strfileResponse.buffer=trueResponse.ClearSet s=server.createobject ("ADODB. Stream ")S.openS.type=1On Error Resume NextSet fso=server.createobject ("Scripting.FileSystemObject")If not fso.fileexists (strFileName) ThenFrom_url=cstr

ASP Operations xml--Delete a node in an XML file

All nodes in the piece, there is a delete and edit two connections next to each node, where the code to delete is:Id=request ("id")If IsNumeric (ID) =false or isNull (ID) ThenResponse.Write ("parameter is not correct, please return!")

asp.net in C # ObjectCache, OutputCache cache

The code is as follows Copy Code Cache Action Classpublic class Cache{private static list _allusecachekey = new list ();private static ObjectCache _cache = Memorycache.default; Add cachekey unique Value Timeout public static void

ASP common database connection and operation method and skill

1.ASP connect to an Access database Dim conn,mdbfile Mdbfile=server.mappath ("database name. mdb") Set Conn=server.createobject ("Adodb.connection") Conn.Open "Driver={microsoft Access Driver (*.mdb)};uid=admin;pwd= database password; dbq=" &mdbfile

An effective method to prevent ASP injection

  code is as follows copy code function Killn (ByVal s1) ' filter numeric parameter if not IsNumeric (S1) then killn=0 Else if s1〈0 or s1〉2147483647 then Killn=0 Else killn=clng (S1) End-if end-if End Function

ASP SQL anti-injection code

Dim sql_injdataSql_injdata = "' |and|or|exec|insert|select|delete|update|count|*|%| Chr|mid|master|truncate|char|declare "Sql_inj = Split (Sql_injdata, "|")If request.querystring<> "" ThenFor all SQL get in Request.QueryStringFor Sql_data=0 to

ASP SQL Security filtering and anti-injection program code

chr

'**************************************************' Function name: Replacebadchar' Function: Filter illegal SQL characters' Parameters: Strchar-----The characters to filter' Return value: Filtered character'******************************************

ASP prevents code from being refreshed

Prevent refreshing pages'================================================Sub Preventrefresh ()Dim Refreshtime,isrefreshRefreshtime = 10 ' Prevent refresh time, unit (seconds)Isrefresh = 1 ' Use anti-refresh function, 0 = no, 1 = yesIf Isrefresh = 1

Tips for improving ASP applications (2)

(2) If you are using a version of VBScript 5.0 or higher, you can use the with ... End-with structure, which can also improve the performance of the ASP. (3) Generally, avoid the use of session variables, because each session variable takes up a

Several methods for connecting to Mssql in ASP!

  Method 1:Dim connSet conn = server. createobject ("ADODB. connection ")Conn. open "PROVIDER = SQLOLEDB; data source = db.janusgroup.cn; UID = web286418; PWD = j2z0h1v2; DATABASE = www_janusgroup_cn"Set conn = Server. CreateObject ("ADODB.

Convenient ASP paging program

Set conn = server. createobject ("adodb. connection ")DBPath = Server. MapPath ("sap_mis.mdb ")Conn. Open "driver = {Microsoft Access Driver (*. mdb)}; dbq =" & DBPathSet rs = server. createobject ("adodb. recordset ")SQL = "select sap_adon_record. *

ASP: securely writes data to the database, reads data normally, and displays data in different scenarios

  For example, if the field styledesc is used, the data must be 50 bits and char characters. Can I limit only 50 bits,All characters can be entered. As long as it is char-type, it can be used as long as the database permitsIn this way, securely

Implementation of Cookie read/write in ASP

Writecookie. asp%> Cookie writing example Response. Write "Write Cookie: "Response. Cookies ("Cookie1") ("key1") = "KeyValue1"Response. Cookies ("Cookie1") ("key1") = "KeyValue2"Response. Cookies ("Cookie1"). Expires = "July 31,199 9"Response.

ASP disables external data submission

Server_v1 = Cstr (Request. ServerVariables ("HTTP_REFERER "))Server_v2 = Cstr (Request. ServerVariables ("SERVER_NAME "))If mid (server_v1, 8, len (server_v2) <> server_v2 then%>Warning! You are submitting data from outside !! Please terminate now !!

Use ASP technology to develop a WEB survey (voting) system (1)

Outline     This article introduces the implementation of a WEB survey system (also called a voting system) implemented by ASP technology, the system allows you to create and maintain browser-based survey projects, dynamically generate survey forms,

Upload files using ASP and VBScript (1)

Uploading files from a browser is an easy way to transfer files from a client to the server. Since the third-generation browsers Netscape and Microsoft, most browsers can upload files to the server without providing users with special access methods

Upload files using ASP and VBScript (2)

Upload script usage     The following is an example of a script Upload application. The downloaded files in this article provide the files and code in the example. Release the compressed file to a path and configure a virtual path for your network

ASP constant table (2)

15. ErrorValueEnum constantThe name, value, and description of the ErrorValueEnum constant are shown in the table F-15.Table F-15ErrorValueEnum constant name, value, and descriptionName value descriptionAdErrBoundToCommand3707 because the Command

Total Pages: 1800 1 .... 1042 1043 1044 1045 1046 .... 1800 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.