The first two days in a station version of the enterprise search engine, found that some sites can link site content.
Strange under Look, the original is according to the database ID automatic numbering rules to link ~ ~
Spare time to get the following this dongdong, hope for everyone in the future to write ASP program Help!
<%
''//生成指定位数的随机数字
''//也可以用Guidy写的iXuEr_Rnd_Str函数,自带15种样式,可以伪MD5啦!!
Function rndStr(strLong)
Dim tempStr
Randomize
Do While Len(rndStr) < strLong
tempStr=CStr(Chr((57-48)*rnd+48))
rndStr=rndStr&tempStr
Loop
rndStr=rndStr
End Function
%>
The following are examples of parameters submitted in form forms for Request.Form, parameters that need to be passed doaction the original value is the ID read from the database
<form name=iform action="ABC.asp" method="post">
<input name=doAction type="hidden" value="<%=rndStr(10)%><%=Rs("ID")%><%=rndStr(10)%>">
</form>
Attention:
The value of the above doaction has changed, each refresh page to get a different value ~ ~
Here is the abc.asp page
First get the value of Doaction
doAction = Trim(Request.Form("doAction"))
Below you can add a little verification, such as IsNumeric!
And then we'll break down the doaction value.
Dim LastID
doAction = Mid(doAction,11)
LastID = Mid(doAction,1,Len(doAction)-10)
If you are familiar with the mid function, the contents of the above can be easily guessed, simple?
Here is the actual example:
Original Doaction the ID to pass is in the database (field type is AutoNumber) value is: 34
Description
11 of Mid (doaction,11) generates random character digits of +1 for you
The 10 LastID = Mid (doaction)-10) is the number of random character digits that are generated for the specified generation!
Dim LastID
doAction = 3614354944348151287527 — 经过伪装后的ID值(完全可以当数字来验证)
doAction = Mid(doAction,11)
LastID = Mid(doAction,1,Len(doAction)-10)
LastID = 34
I experimented with it, and if combined with randomly generated letters and numbers, it could be a MD5-like value!
Just a condition, to be able to specify the number of digits of random characters!
Haha, now everybody Response.Write output LastID value to see, is it also the ID of the database?
This method can be applied to the video parameters of the encryption, download and so on. If you do the government's official document circulation system, you can also use the file above!
For Request.QueryString is also the same reason! Divert ...
The above is I in the preparation of ASP program a little experience, deficiencies please correct me!