[eluser]nZac[/eluser]
[quote author="tzvika" date="1240745844"]Hi.
I've got a web site based on ci with a shopping cart.
the url for adding a product is example.com/cart/add/[product id]
but i don't want that users will refresh accidentally and it will create problems , or maybe will click back and forward on browser, and try to add the product again.
What should i do? can i make a a redirect on view? use ajax?
please suggest.
Thanks.[/quote]
AJAX would be a good way to do it. If you don't what to use AJAX you could check to see if the user has added that product before and if they have, have a confirmation box ask them if they want to add it again.
Personally I would chose AJAX basically because you would not have to refresh, and it does not have a pop-up. Up to you!