http://www.sparse.com/docs/linking.html
However, you can also use the query
portion of the URL to pass data to the page you're aiming for. Queries
consist of a set of variables and the values associated with them. For
example,http://www.sparse.com/docs/linking.html?name=Daniel&gender=male&intelligence=very%20high
Name | Explanation |
---|---|
sparse_id | This is the index of the template on the page. Because Sparse allows more than one template per page, this is necessary to tell it which template we're dealing with. If you only have one template, you can leave this out. Otherwise, set this to 0 for the first template on the page, 1 for the second template, etc. |
sparse_page | The page to display (page 1, 2, 3, etc.) You can only use this if you have "Next" or "Previous" buttons or an sqlnavigation tag in your template. |
sparse_search[name] | The search terms to execute. "Name" is the name of the field
you want to search. You can include multiple search terms in a single
URL, e.g. sparse_search[field1]=value1&sparse_search[field2]=value2... |
sparse_limit | The number of items to display at once. |
sparse_sort[] | The name of a field to sort by. |
sparse_sort_order[] | ASC or DESC (for ascending or descending). By default this is ASC, so you can ignore it if that's what you want. This goes along with sparse_sort, and again, you can include any number of sparse_sort and sparse_sort_order variables, and the data will be sorted by the first one it sees, then the second one, etc. |
http://www.sparse.com/mytemplate.phtml?sparse_search[managerID]=56&sparse_limit=5&sparse_sort[]=employeeName
<tr>
<th><a
href="?sparse_sort[]=name">Name</a></th>
<th><a
href="?sparse_sort[]=address">Address</a></th>...
</tr>
<form action="mySparsePage.phtml" method="POST">
<input type="hidden" name="sparse_id" value="1">
Search for name: <input type="text"
name="sparse_search[name]">
Rows to display: <input type="text" name="sparse_limit">
<input type="submit"></form>
Previous: Errors | Configuring Sparse | Next: Advanced PHP Usage