How to save search criteria for use beyond a form action
I have just created a custom search form (first form) for a table that holds 35K clients. The search works fine. The result page lists the clients that match the search criteria. If you click on a client, a pop-up window lets you edit the client info (second form) and then save the changes.
The problem is that when you click Save Changes on the second form the window closes and returns you to the search results page, but the search criteria are gone so it tries to list all 35k clients and hangs the browser. Not sure how to save the value of the search query variable. I have tried everything I can think of and finally had to disable the pop-up window.
Here is the last thing I tried, but the value for $page gets lost by the time it gets to this file... the ideal result would be for the search results page to show with the filtered list that was there before the pop-up edit window, but at this point I'll settle for going back to the search page. But even that doesn't work! Please help. Mahalo, e :)
Code:
if($page == 'search-clients'){
header('Location: /admin/php/search-clients.php');
} else {
// Refresh Client Listing
$header2 ="<SCRIPT LANGUAGE='JavaScript'>\n";
$header2.="<!-- Begin\n";
$header2.="page = opener.document.URL;\n";
$header2.="opener.document.location = page;\n";
$header2.="window.close();\n";
$header2.="// End -->\n";
$header2.="</script>\n";
echo $header2;
}
exit;
?>