It is a
transfer protocol. It is designed to enable communications between clients and
servers. It has the following detailed architecture –
HTTP
supports the following two request methods –
·
get – In this
method we don’t have security for our data and only limited data can be sent to
the server page. It carries raw data between client-server. This is the default
method of form.
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8"/>
<title>Welcome</title>
</head>
<body>
<form action="home.html" method="get">
<input type="text" name="user"><br/>
<input type="password" name="pass"><br/>
<input type="submit" value="Login">
</form>
</body>
</html>
Get method
satisfies the following list of point –
§ get
request can be catched.
§ get request
remain in the browser history.
§ get request
can be bookmarked.
§ get request
should never be used when dealing with sensitive data.
§ get request
have length restrictions.
Action Attribute – It is
used to specify the URL of the server page to which we want to send our data.
Syntax - <form name=”myform” action=”user.aspx”>
·
post – In this
method we have security for our data and we can send bulk of data to the server
page. It transfers encrypted data from client to server
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8"/>
<title>Welcome</title>
</head>
<body>
<form action="home.html" method="post">
<input type="text" name="user"><br/>
<input type="password" name="pass"><br/>
<input type="submit" value="Login">
</form>
</body>
</html>
No comments:
Post a Comment