1. Prevent users from direct access to the page (prevent self-made form submission, direct access via link)
function Checkprepage ()
Url=request. ServerVariables ("Http_referer")
Url=trim (replace (URL, "http://", ""))
Url=trim (Url,len (Request). ServerVariables ("SERVER_NAME")))
If Url<>trim (request. ServerVariables ("SERVER_NAME")) then
Response. Write ("Please visit this site in a proper way")
Response. End ()
End If
End Function
2. Through the two function can realize the picture, the text at the same time submit processing.
Function binarytostring (str)
Strto = ""
For I=1 to LenB (str)
If AscB (MidB (str, I, 1)) > 127 Then
Strto = Strto & Chr (ASCB (MidB (str, I, 1)) *256+ASCB (MidB (str, i+1, 1))
i = i + 1
Else
Strto = Strto & Chr (AscB (MidB (str, I, 1))
End If
Next
Binarytostring=strto
End Function
function Gainformdata (n)
Dim formsize,formdata,divider,datastart,dataend
ReDim MyData (N-1)
Formsize = Request.TotalBytes
Formdata = Request.BinaryRead (formsize)
For I=1 to N
Bncrlf = ChrB (+) & ChrB (10)
Divider = LeftB (FORMDATA,CLNG (InstrB (FORMDATA,BNCRLF))-1)
Datastart = InstrB (Formdata,bncrlf & Bncrlf) +4
Dataend = InstrB (datastart+1,formdata,divider)-datastart-2
MyData (i-1) = MidB (formdata,datastart,dataend)
FORMDATA=RIGHTB (FORMDATA,CLNG (FORMSIZE-INSTRB (Datastart+1,formdata,divider)) +1)
Formsize=lenb (Formdata)
Next
Gainformdata=mydata
End Function
Demo:
A.htm:
<form name= "Form1" method= "Post" action= "b.asp" enctype= "Multipart/form-data" >
<textarea name= "TXT" ></textarea>
<input type= "File" name= "file" >
<input type= "Submit" name= "Submission" value= "submitted" >
</form>
B.asp:
' Link Database
Data=gainfromdata (2)
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