Jump to content

How to use PHP in XML for the Live Search Script


Recommended Posts

How can I use PHP Code for the links.xml file for the Live Search Script (http://www.w3schools.com/php/php_ajax_livesearch.asp).

 

I have thousands of Links, which I want to be searchable.

<?phpforeach ($verbs["a"] as $key => $list) {echo '<link>'."n";echo '<title>'.($verbs["a"][$key]).'</title>'."n";echo '<url>a/'.letter($verbs["a"][$key]).'/</url>'."n";echo '</link>'."n";} ?>

I want also to know, how to change the script, because I want, that the first letter should be find only words, which starts which this letter and so on.

 

like

Search: A

Alfred

Andy

Anna

Astrid

 

Search: An

Andy

Anna

Link to post
Share on other sites

the short answer is like this:

<?php//put your substr() function here?>

The longer answer has to do with using an environment that responds to php. I use a localhost based on the download at wampserver.com

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...