Recommended: ASP tips: Five ways to disable page caching 1. Add the following referenced content at the head of the Asp page: Response.Buffer = True Response.ExpiresAbsolute = Now() - 1 Resp
Using Microsoft.XMLHTTP to submit data to achieve refresh-free client
| The following is the quoted content: <SCRIPT LANGUAGE=vbScript> dim i, strReturn function xmlhttp_submit(form_object,url) alert() for i = 0 to form_object.elements.length-1 set elem = form_object.elements(i) form_value=form_value & URLEncoding(elem.name) & = & URLEncoding(elem.value) && Next set xmlhttp = CreateObject(Microsoft.XMLHTTP) xmlhttp.open POST,url,false xmlhttp.setRequestHeader CONTENT-TYPE,application/x-www-form-urlencoded xmlhttp.send(form_value) ysinfo.innerHTML=form_value msg.innerHTML=xmlhttp.ResponseText end function 'The above code traverses the objects in the form, assembles the form_value string, and then sends it to the server in POST mode (not limited by length) through the send() method. 'It's also a classic Chinese encoding problem. You need to add an additional URLncoding function to encode the string of variable values into UTF-8 format. Therefore, you have to use VBScript that you are not familiar with to write form_submit(). Function URLEncoding(vstrIn) strReturn = For i = 1 To Len(vstrIn) ThisChr = Mid(vStrIn,i,1) If Abs(Asc(ThisChr)) < &HFF Then strReturn = strReturn & ThisChr Else innerCode = Asc(ThisChr) If innerCode < 0 Then innerCode = innerCode &H10000 End If High8 = (innerCode And &HFF00)/ &HFF Low8 = innerCode And &HFF strReturn = strReturn & % & Hex(Hight8) & % & Hex(Low8) End If Next URLEncoding = strReturn End Function </SCRIPT> |
Share: Are you ready to prevent script intrusion? As network administrators, many friends are also responsible for the company's website development and maintenance work. I think everyone is proficient in WEB development, but they are good at writing secure script code and how intruders penetrate the server through WEB. Maybe not very clear