Hmm, the search form submits using GET: -
<form id="searchart" name="searchart" method="get" action="rrpg_results.php">
Yet the colparam snippet is expecting POST vars.
if (isset($_POST['search'])) {
$colname_rsSearchResults = (get_magic_quotes_gpc()) ? $_POST['search'] : addslashes($_POST['search'
}
I recon changing the colparam to GET would do the trick, because then this lil snippet transferrs the search value to via the querystring:
if (count($newParams) != 0) {
$queryString_rsSearchResul
}
So, all you would have to do is change the colparam code...
Main Topics
Browse All Topics





by: jason1178Posted on 2009-08-25 at 19:13:02ID: 25183967
>> I think this is because the variable I define as my text field (i.e. search term) to populate the table is not carrying
]);
>> over to the second page
You are correct. See lines 12-15 above:
$colname_rsSearchResults = "-1";
if (isset($_POST['search'])) {
$colname_rsSearchResults = (get_magic_quotes_gpc()) ? $_POST['search'] : addslashes($_POST['search'
}
This indicates that you are using the contents of a form field called "search" to limit the database. Furthermore, you are POSTing the form. So the first time the form is submitted, the $_POST array is set. But as soon as you navigate again (via the navigation bar), the $_POST variable is no longer set.
You have two choices here.
1) Use method=get instead of method=post in the original form. That will write the search terms to the query string and the navigation bar behavior will adapt. You will need to redefine the rsSearchResults recordset to filter on URL Parameter instead of Form Parameter (change $_POST to $_GET).
2) Keep the form the same way, but add some PHP code that writes $_POST['search'] to a session variable. In this case, you would then redefine rsSearchResults to filter on Session Variable.
Depending on how comfortable you are with PHP at this point, #1 is easier to accomplish. #2 is more elegant but requires some knowledge about how PHP sets and handles session variables.