PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Extractable info - API for CGI version

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Extractable info - API for CGI version

    Hi there

    Would it be possible to add extractable information to the cgi script such as extractable number of results etc. Sort of like a google api.

    It can be done with php and asp but because the cgi is a binary excecutable, its much more difficult.

    I want to be able to see e.g. how many results a query would give and then write a program based upon that.

    Thank you

  • #2
    You can certainlly call the CGI from another application and get results from back it.

    This is exactly what we have done for a demo product called the "CGI Front end". See here,
    http://www.wrensoft.com/zoom/support/cgifrontend.html

    On the page above you will find a short descritpion of how it was done and the source code for the example.

    The output from the CGI script is XHTML however. So you would need to parse this in order to get the information you wanted and ignore the rest of the XHTML.

    --------
    David

    Comment


    • #3
      If I was to say write some code in php which would send the query string to search.cgi, how would i go about telling search.cgi not to post the results to search_template.htm but to my script

      thank you

      Comment


      • #4
        > how would i go about telling search.cgi not to post
        > the results to search_template.htm but to my script

        Zoom doesn't post results.

        To embed search.cgi within a PHP file, use the following code (replacing the path to the search.cgi as appropriate):

        <?php
        $QSTRING = $_SERVER['QUERY_STRING'];
        while (list ($header, $value) = each ($HTTP_GET_VARS))
        {
        $QSTRING = $QSTRING.'&'.$header.'='.$value;
        }
        virtual("/cgi-bin/search.cgi".'?'.$QSTRING);
        ?>

        There are some additional details here,
        http://www.wrensoft.com/zoom/support...i.html#ssi_cgi

        ------
        David

        Comment

        Working...
        X