Jump to content
xisto Community
mrdee

Searching And Highlighting

Recommended Posts

Hello,

I am looking for a search box to put on my website (Java, PHP, HTML, whatever, it does not matter, as long as it does the job).

 

There are still many people out there who are not aware of the combination [CTRL-F] to search for particular words/phrases on a web site.

 

That is why I would like to have a box on top of my page where people can enter a search term and then see the searched for terms highlighted.

 

I had one yesterday that seemed to do the trick (A Java app), it highlighted what you looked for, except, it did not jump towards the highlighted terms, so you still had to scroll through the page to find the highlighted words.

 

After all, we are talking about a very long page, it has a list of all the songs available on my Internet radio station to offer people an insight into what is available and to help them make a choice for the request programme.

 

If anyone knows about such a feature, preferably with no ads, would they please let me know?

 

Thank you in advance.

 

Share this post


Link to post
Share on other sites

Are the song titles coming out of a Database? If so, most databased information can be searched.

 

Otherwise, a PHP script can search page contents, too, but it would require a page refresh. On a long page, it could use some extra Server resources. It would need some testing, of course.

Share this post


Link to post
Share on other sites

Good to hear from you, Jim.

No, the songs do not come from a database, I use Tagscanner to order them nicely from the directory where they are stored, and then let Tagscanner generate the HTML code.

 

It is obviously one heck of a long list with nearly 1500 songs.

 

I had thought of using MySQL/PHP, but that is a bit beyond me to do it myself.

 

Thanks for your reaction.

Share this post


Link to post
Share on other sites

Anyway, I managed to get there.

I just put my whole list in a MySQL table and then used PHPRunner to make the search page.

 

However, is there anybody here if I can repair the following:

One of my fields is the Item number, and it is an Auto-increment field.

 

I noticed that I had a duplicate entry on items 1000 and 1001, and stupidly, I deleted one of them.

Now, when I do a search by number, 1000 gives me an empty field.

 

Does anyone know if i can do something so that what used to be 1001 now becomes 1000 and so on, so that my whole list remains numbered properly without skipping any numbers?

 

Thank you.

Edited by mrdee (see edit history)

Share this post


Link to post
Share on other sites

You would need to run a script (php probably) to read the existing database table sequentially and then write the information into a new database table. Not a big deal for someone who knows php and mysql. I have some time if you could private message me with the schema of the database, maybe I could write the script for you???

Share this post


Link to post
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...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.