All pastes #281425 Raw Edit

Untitled

public php v1 · immutable
#281425 ·published 2006-12-16 20:07 UTC
rendered paste body
function find_words() {				$link= $_SERVER['REQUEST_URI'];		$link1 = str_replace("/","",$link);	$a = mysql_query("SELECT post_content from wp_posts where post_name = '$link1'")or die(mysql_error());	$a1 = mysql_fetch_row($a);	$content = $a1[0];	$result = mysql_query("SELECT word,definition from dictionary")or die(mysql_error());	$words=array();	$definition = array();	while($row=mysql_fetch_array($result))		$words[]= "/\\b($row[0])\\b/";		$definition[]=$row[1];$replace = "$1 <a href=\"#\" onMouseover=\"ddrivetip('<b>Definition:</b> $definition')\"; onMouseout=\"hideddrivetip()\">[?]</a>";	$newData = preg_replace($words, $replace, $content);	echo $newData;}