Now I want it to highlight the word on the page...
My Code:
$hlight = htmlspecialchars($_GET['highlight']);
function hlight($word){
if($hlight){
$word = eregi_replace($hlight, '<span style="color:#FFFF99;">' . $hlight . '</span>', $word);
} else {
$word = $word;
}
return $word;
}
Now i use it like so and all the variables are defined.
www.site.com/index.php?showtopic=1&highlight=testing
Now either way If i use it with or without &highlight=testing It still displays the regular text/content or $word without the highlighting.
Can anybody help. It's probably something stupid lol
