Recommended: ASP Development Guidelines The application server is, or will eventually be used by a web server, and it is usually the IIS computer running the ASP page. ASP is the only client of your object. It brings special threading and security considerations. Although many Web sites that use ASP do not use it at all
In many cases, it is necessary to prevent the same form from being submitted multiple times. Many people's implementation methods are relatively complicated (the number of code exceeds dozens of lines!!) The following provides a method that only requires a few lines of code, which easily prevents users from refreshing multiple submissions and repeating multiple submissions using the back button.
File 1: Form file formtest.asp
| The following is the quoted content: <% Randomize 'Initial Generation Random Number Seed num1=rnd() 'Create a random number num1 num1=int(26*num1) 65 'Modify the range of num1 to be the Ascii code of the AZ range in case the form name error session(antry)=test&chr(num1) 'Create a random string %> <form name=test action=testact.asp method=post> Your name: <input type='text' name='' size=30> 'Note that random form item names are used in this line <input type='submit' value='submit'> </form> form handler testact.asp <% teststr=request.form(session(antry)) if teststr= then response.write no name or repeated submission 'The user did not fill in the name, or the form was submitted repeatedly (the flag is session(antry) is empty) else response.write teststr session(antry)= 'Submission is successful, clear session(antry) to prevent repeated submissions! ! end if %> |
Here, you just need to randomize the form item name of a required item, without having to randomize all form items.
Share: Share: Introduction to the properties and methods of XML HTTP Request Since you are now responsible for making standard static pages in the company, in order to enhance the customer experience, you often have to do some AJAX effects, and learn AJAX like me. An important technology (tool) used when designing AJAX is the XMLHTTPRequest object. here