Querystrings

Permalink
I'm trying to link to different pages, passing data through a querystring such as:
<code>
<a href="/new_product/product_id=2">Add product</a>
</code>

This is all database-driven so the passed data will always be different. How do I do this through concrete5 since everything is through index.php?

Thanks!

 
jordanlev replied on at Permalink Reply
jordanlev
The sample code you posted is not a querystring. A querystring is everything after a question mark (?). Put your data after a question mark and it should just work:
<a href="/new_product?product_id=2">Add product</a>

And if you have more than one piece of data, separate them with an ampersand (&):
<a href="/new_product?product_id=2&product_name=test">Add product</a>


This is all basic URL functionality by the way -- it's not specific to how C5 works.