Redirecting after form submission

Another option after a successful form submission is to redirect the user to a confirmation or success page by adding the AMP-Redirect-To header to the server response. This means we could redirect the user to a dedicated cart page after submitting the add-to-cart form. However, once the user is on the cart page, we still need to figure out how to get the cart data from the server without having the user submit a form; again, we'll see how to achieve this in the next chapter.

Get AMP: Building Accelerated Mobile Pages now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.