Hi,
Have a quick question. I've been using Zoom for about 2 years now(v6) and have made quite a few websites now and usually always need to create a search page in php. I always use this code and it works:
<?php
$QSTRING = $_SERVER['QUERY_STRING'];
$REMADDR = $_SERVER['REMOTE_ADDR'];
putenv("REQUEST_METHOD=GET");
putenv("QUERY_STRING=$QSTRING");
putenv("REMOTE_ADDR=$REMADDR");
// absolute path to search.cgi required below
$output = shell_exec("C:\inetpub\wwwroot\search\search.cgi") ;
$output = ereg_replace("Content-type: text/html;", "", $output);
echo $output;
?>
So I created a new website and using this code, I could not get it to work. I came here and copied the code from the tutorial which was this:
<?php
$QSTRING = $_SERVER['QUERY_STRING'];
$REMADDR = $_SERVER['REMOTE_ADDR'];
putenv("REQUEST_METHOD=GET");
putenv("QUERY_STRING=$QSTRING");
putenv("REMOTE_ADDR=$REMADDR");
// absolute path to search.cgi required below
$output = shell_exec("C:\\inetpub\\wwwroot\\search\\search.c gi");
$output = ereg_replace("Content-type: text/html;", "", $output);
echo $output;
?>
My only conclusion was my absolute path was wrong, it need the double \\ not just one \
But if that is the case then why did it work for my other sites?
Just curious, would like to know exactly what went wrong here for future reference.
Thanks!
Have a quick question. I've been using Zoom for about 2 years now(v6) and have made quite a few websites now and usually always need to create a search page in php. I always use this code and it works:
<?php
$QSTRING = $_SERVER['QUERY_STRING'];
$REMADDR = $_SERVER['REMOTE_ADDR'];
putenv("REQUEST_METHOD=GET");
putenv("QUERY_STRING=$QSTRING");
putenv("REMOTE_ADDR=$REMADDR");
// absolute path to search.cgi required below
$output = shell_exec("C:\inetpub\wwwroot\search\search.cgi") ;
$output = ereg_replace("Content-type: text/html;", "", $output);
echo $output;
?>
So I created a new website and using this code, I could not get it to work. I came here and copied the code from the tutorial which was this:
<?php
$QSTRING = $_SERVER['QUERY_STRING'];
$REMADDR = $_SERVER['REMOTE_ADDR'];
putenv("REQUEST_METHOD=GET");
putenv("QUERY_STRING=$QSTRING");
putenv("REMOTE_ADDR=$REMADDR");
// absolute path to search.cgi required below
$output = shell_exec("C:\\inetpub\\wwwroot\\search\\search.c gi");
$output = ereg_replace("Content-type: text/html;", "", $output);
echo $output;
?>
My only conclusion was my absolute path was wrong, it need the double \\ not just one \
But if that is the case then why did it work for my other sites?
Just curious, would like to know exactly what went wrong here for future reference.
Thanks!
Comment