WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

ASP Forms and User Input


The Request.QueryString and Request.Form directions are utilized to recover client contribution from forms.


User Input

The Request item can be utilized to recover client data from forms.

User information can be recovered with the Request.QueryString or Request.Form command. 


Request.QueryString

The Request.QueryString order is utilized to gather esteems in a structure with method="get".

Information sent from a structure with the GET strategy is unmistakable to everybody (it will be shown in the program's location bar) furthermore, has constrains on the measure of data to send.

Example HTML form

<form method="get" action="simpleform.asp">
First Name: <input type="text" name="fname"><br>
Last Name: <input type="text" name="lname"><br><br>
<input type="submit" value="Submit">
</form>

If a client composed "Hello" and "world" in the HTML structure over, the URL sent to the server would look like this:

http://www.welookups.com/simpleform.asp?fname=Hello&lname=world

Assume that "simpleform.asp" contains the accompanying ASP script:

<body>
Welcome
<%
response.write(request.querystring("fname"))
response.write(" " & request.querystring("lname"))
%>
</body>

The program will show the accompanying in the body of the document:

Welcome Hello world

Request.Form

The Request.Form direction is utilized to gather esteems in a structure with method="post".

Information sent from a structure with the POST strategy is imperceptible to other people and has no restrictions on the measure of data to send.

Example HTML form

<form method="post" action="simpleform.asp">
First Name: <input type="text" name="fname"><br>
Last Name: <input type="text" name="lname"><br><br>
<input type="submit" value="Submit">
</form>

If a client composed "Hello" and "world" in the HTML structure over, the URL sent to the server would resemble this:

http://www.welookups.com/simpleform.asp

Assume that "simpleform.asp" contains the accompanying ASP script:

<body>
Welcome
<%
response.write(request.form("fname"))
response.write(" " & request.form("lname"))
%>
</body>

The program will show the accompanying in the body of the document:

Welcome Hello world

Form Validation

User info ought to be approved on the program at whatever point conceivable (by customer contents). Program approval is quicker and decreases the server load.

You ought to think about server approval if the client information will be embedded into a database. A decent method to approve a structure on the server is to post the structure to itself, rather than hopping to an alternate page. The client will at that point get the blunder messages on indistinguishable page from the structure. This makes it simpler to find the error.