Login   Register  
PHP Classes
elePHPant
Icontem

File: referersample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Setec Astronomy  >  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: 10 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 ($keywordsfalse'my_highlighter');
}
readfile ('http://www.w3c.org/');
?>