Sorry for double posting. My first time here.
I found the PHP Ajax Live Search code here > http://www.w3schools.com/php/php_ajax_livesearch.asp
I edited an rss/xml feed for recent listings from a php directory I use the same as the links.xml file example they give & got it working > http://www.easysavannah.com/livesearch.html
Problem is I cannot get it to search the "description", only the "title" & "url". The "livesearch.php" listed here >> http://www.w3schools.com/php/php_ajax_livesearch.asp seems to mirror in ways the php for the MSN Live Search API code > http://dev.live.com/blogs/livesearch...01/08/445.aspx
w3school's code snippet:
Quote:
$hint="";
for($i=0; $i<($x->length); $i++)
{
$y=$x->item($i)->getElementsByTagName('title');
$z=$x->item($i)->getElementsByTagName('url');
if ($y->item(0)->nodeType==1)
{
//find a link matching the search text
if (stristr($y->item(0)->childNodes->item(0)->nodeValue,$q))
{
if ($hint=="")
{
$hint="<a href='" .
$z->item(0)->childNodes->item(0)->nodeValue .
"' target='_blank'>" .
$y->item(0)->childNodes->item(0)->nodeValue . "</a>";
}
else
{
$hint=$hint . "<br /><a href='" .
$z->item(0)->childNodes->item(0)->nodeValue .
"' target='_blank'>" .
$y->item(0)->childNodes->item(0)->nodeValue . "</a>";
MSN Live Search php snippett:
Quote:
echo('<li class="resultlistitem"><a href="' . $value->childNodes->item(2)->nodeValue . '">'); //Url echo('<h3>' . $value->childNodes->item(0)->nodeValue . '</h3></a>'); //Title echo('<p>' . $value->childNodes->item(1)->nodeValue . '</p>'); //Description } echo("</ul>");
I've tried a multitude of ways to add an echo into "w3"s code for allowing the code to search a description in an xml page.
Has anyone seen a solution for this? Any help would be appreciated. Thanks, Gene
PS. Code sample on index page of directory I'm testing > http://www.easysavannah.com/index2.html (middle below header)