Associating an ID with a Web Page
Many times, you need to associate an ID with a web page.
For example, several users are using the same page to purchase products at the same time.
You need to tell which user is using this specific page.
Several methods can be used to achieve this function like
- Session, which is a way to store information (in variables) to be used across multiple pages,
- Cookie, which is a small file that the server embeds on the user’s computer,
- HTML hidden attribute, which is used to keep a user from seeing an element until some other condition has been met (like retrieving the user ID), and
- GET method, which is used to request data from a specified resource.
This slide shows how to use the GET method to associate an ID with a web page (a standalone page is here):
The first page
1.html
uses the POST method to receive the user name and the first script
1.pl
composes the second page, which uses the GET method to relay the user name to the next page.
The second page is divided into three parts, so the user name can be embedded into the page:
The third page is also divided into three parts:
Rome was not built in one day.
|