0

So lets say there are two html pages : page1.html and page 2.html.

In the page one there will be a list of food items displayed with a check box to each food item. The total bill will be displayed in the corner. When the user clicks the order button , The food items list that the user selected and the total amount should be sent to page2.html.

I can code upto the design and calculating the total of the items that the user selected.

But how do i send them to the page2?

Patrick
  • 5,526
  • 14
  • 64
  • 101
  • Pass values as url params and read in your second page. Refer here https://stackoverflow.com/questions/979975/how-to-get-the-value-from-the-get-parameters – Fawaz Oct 14 '17 at 10:52
  • You could include the data in the request, such as with query string values or POST values (the latter generally requires server-side code as well). Or you could persist the data in some storage medium, such as a cookie or Local Storage in the browser. – David Oct 14 '17 at 10:52
  • I want to avoid server side as much as possible, anyways i will try with the url parameters – gahaninadh b Oct 14 '17 at 10:56

1 Answers1

0

Numerous ways to do this but the easiest is to send them in the query string, such as:

http://localhost/page2.html?food1=hamburger&food2=fries
Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Patrick
  • 5,526
  • 14
  • 64
  • 101