About ASP Generation pseudo parameter technique simple and practical pseudo (difference.) Parameter _ Application Skill

Source: Internet
Author: User
Tags md5
Simple and practical pseudo (difference.) parameters
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!

Copy Code code as follows:

<%
Generate a random number with a specified number of digits
can also use Guidy write Ixuer_rnd_str function, with 15 kinds of styles, can be pseudo 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 (a)%><%=rs (" ID ")%><%=rndstr (a)%>" >
</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.

Copy Code code as follows:

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-After a disguised ID value (can be validated as a number)
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!
You can take a few in the middle as needed, or you can
Related Article

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.