Welcome Guest, Not a member yet? Register   Sign In
Using a form + uri segments?
#1

[eluser]Dauntless[/eluser]
Hi,

I have a list of products (=catalog) where you can order the products by entering the amount and pressing 'order'. Now, you click the 'order' button directly from the product list (and not from a separate product-page). I have a controller function 'addToCart' that accepts 2 arguments: productID & amount. How can I put these things to getter? The user has to fill in a number (the amount), press 'order' and it should go to 'addToCart/productID/amount' .

Can this be done? Or do I have to rewrite the 'addToCart' function so that it processes $_POST ?

Greets,
Dauntless
#2

[eluser]coolfactor[/eluser]
$_POST would probably be better for this type of things. In order to submit those values into the url, you'd need some javascript to generate a dynamic url for the form's action attribute.
#3

[eluser]Dauntless[/eluser]
I guess that's best... It's not like I want google to index a 'buy' page, so the url approach doesn't make a lot of sense Smile

Thank you.




Theme © iAndrew 2016 - Forum software by © MyBB