This is my situation. I have one page that is like a search results page for around 5 different types of ways a user can search for records. lets say a user searches by type (which is one of my searches)--> to be able to click on a letter, like G, and narrow down the search by those records that start with the letter G.
However,
another user might search by type and location--> that would give different results. and i want the same time as above.
The way i have it now, if the user clicks on G, it'll show ALL the records that start with G, regardless of the search results showing on the page. So what im hoping is to have a code that says: (user clicks on G) narrow these records (the ones on the page) that start with the letter G.
this is what i have, but it doesnt narrow down the search, it shows ALL the records, now i thought, what if this code simply adds itself to the url, for example....www.site.com/type=food&letter=c.
whereas how i have it now is www.site.com/letter=c --> thats why it's sorting through ALL the records....
thank you
However,
another user might search by type and location--> that would give different results. and i want the same time as above.
The way i have it now, if the user clicks on G, it'll show ALL the records that start with G, regardless of the search results showing on the page. So what im hoping is to have a code that says: (user clicks on G) narrow these records (the ones on the page) that start with the letter G.
this is what i have, but it doesnt narrow down the search, it shows ALL the records, now i thought, what if this code simply adds itself to the url, for example....www.site.com/type=food&letter=c.
whereas how i have it now is www.site.com/letter=c --> thats why it's sorting through ALL the records....
PHP Code:
<?php $letters = range('A', 'Z');
for ($i = 0; $i < count($letters); $i++) {
print ' <a href="list.php?letter=' . $letters[$i] . '">' . $letters[$i] . '</a> -';
}?>
Comment