Jump to content

How to use PHP in XML for the Live Search Script


Grischa

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 comment
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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...