<?php
 
    require_once ('osearch/opensearch.php');
 
    $tmp=new OSDescriptionDoc('Content search','Test description');
 
    //$tmp->add_self();
 
    //$tmp->set_content_type('application/xml');
 
    
 
    //This should be a absolute path to url, so we should filnd the path (in your case 
 
    //You can do it any how you like.
 
    $protocol=(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']!='')?'https://':'http://';
 
    $host=$_SERVER['SERVER_NAME'];
 
    $path=dirname($_SERVER['PHP_SELF']);
 
    $full_path=$protocol.$host.$path.'/';
 
    //
 
 
    $tmp->add_url($full_path .'search.php' .'?q={searchTerms}&src={referrer:source?}&dtstart={time:start?}&dtend={time:stop?}','text/html') ;
 
    $tmp->add_suggestions($full_path . 'sugestext.php?q={searchTerms}');  
 
    //$tmp->add_image_base64('favicon.png','',16,16);
 
    //or 
 
    $tmp->add_image($full_path .'favicon.png','',16,16);
 
    $tmp->add_language('*');
 
    $tmp->need_referrer_extension(true);
 
    $tmp->need_time_extension(true);
 
    $tmp->serve();
 
    //$tmp->save_to_file('opensearch.xml');
 
?>
 
 |