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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.