Hi.
Im a bit stuck on how to go about this and require advice on how best to go about doing the following:
Basically I have an option to filter the records on my screen and accomplish this by the use of a list/menu item and button that posts data to the same page.
Now the page also has pagination, so the user could choose to view page 2, 3 etc.
So my question is how do I go about building the URL for any page links on this page?
Building a URL based on user input
Moderator: General Moderators
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
Is PHP 5 recommend for live website usage yet?
Last time I used it and upgraded my site in the test environment I got no end of IIS crashes.
Perhaps I give it another go....
Oh just by luck I came across a PEAR package that allows pre PHP 5 users to get some of the new PHP 5 functions inc. the http_build_query!
But I must admit deploying the pEAR framework for just this seems slightly excessive!
Last time I used it and upgraded my site in the test environment I got no end of IIS crashes.
Perhaps I give it another go....
Oh just by luck I came across a PEAR package that allows pre PHP 5 users to get some of the new PHP 5 functions inc. the http_build_query!
But I must admit deploying the pEAR framework for just this seems slightly excessive!
It would be quicker to pass the query string as a hidden value to the next page.
In the case of a link, I generally base64_encode() the dynamic piece of the query and pass it on to the next page of results.
decode it later...
This is by no means the best way, just my way 
In the case of a link, I generally base64_encode() the dynamic piece of the query and pass it on to the next page of results.
Code: Select all
$filter="&& filter='foo' && page='whatever'";
$enc_filter = base64_encode($filter);
<a href=page.php?filter=".$enc_filter.">bar</a>";Code: Select all
$filter=base64_decode($_GETї'filter']);
$query= "SELECT blah...".$filter;- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland