See also:
"Customizing the FDSE layout using PHP"
http://www.xav.com/scripts/search/help/1193.html
';
if ($echo_verbose) {
echo "\n";
echo "
Trace: you can disable these Trace statements by setting \$verbose = 0; in your PHP file.
\n"; echo "Trace: starting function FDSE_output
\n"; } if (!file_exists($search_script)) { return "Error php-3: script file '$search_script' does not exist - check the \$search_script variable.
\n$helptext"; } if (!file_exists($path_to_perl)) { return "Error: Perl interpreter '$path_to_perl' does not exist - check the \$path_to_perl variable.
\n$helptext"; } if ($echo_verbose) { echo "Trace: testing support for shell_exec()
\n"; $teststr = 'Larry Wall'; $command = "$path_to_perl -v"; $output = shell_exec($command); if (strstr( $output, $teststr )) { echo "Success: shell_exec tests ok
\n"; } else { return "Error fdse-php-2: shell_exec() test failed. Command '$command' did not return expected string '$teststr'. Instead returned '$output'.
\n$helptext"; } } # create a readable format for parameters $params = 'is_shell_include=1 search_url=' . urlencode($self_url) . ' '; if ($_SERVER['REQUEST_METHOD'] == 'POST') { foreach ($_POST as $key => $this) { if (get_magic_quotes_gpc()) { #changed 0070 $this = stripslashes($this); } $params .= urlencode($key) . '=' . urlencode($this) . ' '; } } else { foreach ($_GET as $key => $this) { if (get_magic_quotes_gpc()) { #changed 0070 $this = stripslashes($this); } $params .= urlencode($key) . '=' . urlencode($this) . ' '; } } $command = "$path_to_perl $search_script $params 2>&1"; if ($echo_verbose) { $hcommand = htmlspecialchars($command); echo "Trace: running command:
$hcommand
Trace: command returned $len bytes of output.
\n"; } return $output; } ?>