Did you get the “We're experiencing a temporary scripting error” message when you tried to search? That’s the very last echo statement on the redirect.php page.
I’m using Dreamweaver to edit the script and just keep uploading to the site every time I make changes. So you’re seeing what I’m seeing. Is there a better way? (I couldn’t get my testing server to work.)
None of the form Submit buttons are working – same problem with all of them – but I’ll just focus on the “Search” one here. Here’s (I think) the relevant code:
from the search.php page…
echo "<form action=\"redirect.php?\" method=\"GET\">\n";
echo "Choose a subject: ";
// Produce a select list of subjects
//(there’s one of these for each of the searchable fields)
selectDistinct($connection,
"main",
"subject",
"All",
$_GET['subject']);
// Show the user the search screen button
echo "<input type=\"submit\" name=\"search\" value=\"Search\">";
and from the redirect.php page…
include 'include.php';
set_error_handler("errorHandler");
session_start();
// Clean up the data, and save the results in an array
foreach($_GET as $varname => $value)
$parameters[$varname] = clean($value, 10);
// Did they want to finalise the purchase? (one of these for each submit button)
if (!empty($_GET["parameters"]["search"]))
{
// Redirect the browser to the search input page
// using the HTTP response header "Location:"
header("Location: http://www.straittalk.com/sd47/search.php?{$_SERVER['QUERY_STRING']}");
exit;
}
// They got here without providing an option, so there is a problem
echo "We're experiencing a temporary scripting error.";
The only place “parameters” are set is in that “foreach” statement.
Neither Brad’s suggestion
if (!empty($_GET["search"]))
{
nor the original script
if (!empty($parameters["search"]))
{
return any results – in fact, those return a completely blank browser window (instead of that hopeful Echo statement at the bottom of the redirect page.) However, the URL is always the same, with all the proper search string added -- just the wrong filename ("redirect" instead of "search".)