PHP Classes

File: referersample.php

Recommend this page to a friend!
  Classes of Filippo Toso   Key Highlighter   referersample.php   Download  
File: referersample.php
Role: Example script
Content type: text/plain
Description: CReferrer sample file
Class: Key Highlighter
Highlight keywords in current script output
Author: By
Last change:
Date: 20 years ago
Size: 496 bytes
 

Contents

Class file image Download
<?php
require ('keyhighlighter.class.php');
require (
'creferrer.class.php');

function
my_highlighter ($matches) {
    return
'<span style="font-weight: bolder; color: #FF0000;">' . $matches[0] . '</span>';
}

$url = isset ($_SERVER['HTTP_REFERRER']) ? $_SERVER['HTTP_REFERRER'] : '';
$creferrer = new CReferrer ();
$keywords = $creferrer->getKeywords ($url);
if (
$keywords !== false) {
    new
keyhighlighter ($keywords, false, 'my_highlighter');
}
readfile ('http://www.w3c.org/');
?>