I've got a page with a paging script on it and for the "next page" link, I have to send a string ($term). Some of the strings contain an "&" and it's causing part of the string to be dropped and no results are found from page 2 on.
Example:
<a href='/html/chamber/memsearchres.php?page=2&theterm=$theterm&thetype=cat'>2</a>
($the term in this example = Restaurants, Cafes, & Taverns)
Here's what I've tried and the query string results:
Change the link to:
<a href=\"/html/chamber/memsearchres.php?page=2&theterm='$theterm'&thetype=cat\">2</a>
Results:
select * from members where USCC = '\'Restaurants, Cafes, ' group by MemId order by RepCompany_LIMIT 10, 10
(as you see it dropped everything from the & on)
I also tried removing the apostrophes from around the term:
<a href=\"/html/chamber/memsearchres.php?page=2&theterm=$theterm&thetype=cat\">2</a>
and then get:
select * from members where USCC = 'Restaurants, Cafes, ' group by MemId order by RepCompany_LIMIT 10, 10
Either way it drops everything in the passed string from the ampersand on.
Any suggestions how to remedy this? Maybe switch the & for another character to pass it to the next page, and then convert it back?
Even the code for & has an & in it.