PHP Classes

File: sugestext.php

Recommend this page to a friend!
  Classes of Forud A   Open Search for PHP   sugestext.php   Download  
File: sugestext.php
Role: Example script
Content type: text/plain
Description: example
Class: Open Search for PHP
Add support to a given search engine in a browser
Author: By
Last change:
Date: 14 years ago
Size: 888 bytes
 

Contents

Class file image Download
<?php
   
require_once ('osearch/opensearch.php');
    if (isset(
$_GET['q']))
       
$query=$_GET['q'];
    else
        die();
   
$tmp=new OSSuggestions($query);
   
$a=' A';
   
//Just simply add some data .... (for this example) you may add
    //data from database or similar source
   
$tmp->add_field($query.($a++),rand(1,1000).' Results');
   
$tmp->add_field($query.($a++),rand(1,1000).' Results');
   
$tmp->add_field($query.($a++),rand(1,1000).' Results');
   
$tmp->add_field($query.($a++),rand(1,1000).' Results');
   
$tmp->add_field($query.($a++),rand(1,1000).' Results');
   
$tmp->add_field($query.($a++),rand(1,1000).' Results');
   
$tmp->add_field($query.($a++),rand(1,1000).' Results');
   
$tmp->add_field($query.($a++),rand(1,1000).' Results');
   
$tmp->add_field($query.($a++),rand(1,1000).' Results');
   
$tmp->serve();
   
//$tmp->save_to_file('opensearch.xml');
?>