php - Opening a hyperlink in a previous DIV -
i having problems trying open hyperlink in previous div, generated echo in php. purpose of website output definitions of words, each word in separate div. words have 2 or more acceptations suggested *see here live demo... http://verbum.xtrweb.com/verbumpost.php?word=casa&word0=hola * . clicking on of acceptations open definition without style changed on new tab. need replace new tab normal div as in hola in example
thanks! code perhaps...
<?php $words = array('word','word0','word1','word2','word3','word4','word5','word6','word7','word7','word9','word10','word11','word12','word13','word14','word15'); function url_decode($string){ return urldecode(utf8_decode($string)); } $baseurl = 'http://lema.rae.es/drae/srv/search?val='; // string replace in head. $cssreplace = <<<eot <style type="text/css"> //style </style> </head> eot; $spanremove = '<span class="f"><b>.</b></span>'; $resultindex = 0; foreach($words $word) { if(!isset($_request[$word])) continue; $contents = file_get_contents($baseurl . urldecode(utf8_decode($_request[$word]))); $contents = preg_replace('/(search?[\d\w]+)/','http://lema.rae.es/drae/srv/', $contents); echo "<div id='results' style=' //style ", (++$resultindex) ,"'>", $contents, "</div>"; } ?>
if want load page inside dom element, need load in iframe (or frame) not div. div elements cannot target of hyperlink or form.
Comments
Post a Comment