The best way to go about this is to keep a URL variable as you're going through the pages. So anywhere you create the link to go to the next page or back, include a variable of the search term. So something like this:
Then, all you have to do to retrieve it is:
So for your code, it'd be something like this:
[php]
echo "<input type='hidden' name='hiddenField' value = '";
echo $_GET['query'];
echo "'>";
[/php]
Also, when passing variables around through the URL, always consinder SQL Injections. Click here for more info:
http://www.daniweb.com/techtalkforums/thread199.html
Reputation Points: 262
Solved Threads: 18
a.k.a inscissor
Offline 1,227 posts
since Feb 2002