For anyone else trying to embed CGI/Win32 version of search.cgi into a PHP script, and run it under Windows XP, the following may help (the PHP virtual() function is for Unix, and must be substituted for the passthru() which works in a different way):
By default, the output in $results include the HTML header (Content-type: text/html; charset=UTF-8); I think there is an option to disable this under Advanced tab, "Disable charset enforcing on search script".
And I found there is no need to truncate the directory path to DOS 8.3 notation.
Regards,
Ian Tresman
PHP Code:
<?php
//Windows Usage
$QSTRING = $_SERVER['QUERY_STRING'];
putenv('REQUEST_METHOD=GET');
putenv('QUERY_STRING='.$QSTRING);
$command="C:\\dir\\directory\\another-subdiectory\\search.cgi";
ob_start();
passthru ($command);
$results = ob_get_contents();
ob_end_clean();
echo $results;
?>
And I found there is no need to truncate the directory path to DOS 8.3 notation.
Regards,
Ian Tresman
Comment