Page 1 of 1

Adding Search Box to my website

Posted: Sun Jun 28, 2009 11:37 am
by xtremetab
I am working on my website and have a question about a PHP search box.

On my songlist.php page I would like to print the name of the band above the list of songs. Any suggestions on the code?

I would also like to have a search box working at the top of the page where if someone typed the name of the band it would bring them right to the songlist.php of that band.

Take a look at the link below to see what I have so far.

http://www.xtremetab.com/tablature-tab-list-0.php

Any suggestions you have would be great.

Thanks

Re: Adding Search Box to my website

Posted: Sun Jun 28, 2009 2:40 pm
by McInfo
It looks like your search form is currently

Code: Select all

<form method="post">
    <input type="text" name="Text1" />
</form>
If you change it to

Code: Select all

<form method="get" action="songlist.php">
    <input type="text" name="bandname" />
</form>
it should bring up the song list for the searched-for artist. If the artist is not found, the song list is blank, so you might want to do something different when the search fails, like redirect to the tablature-tab-list-X.php page where X is the first letter of the search term.

Without seeing the PHP scripts, there isn't much I can suggest at this point regarding your other questions.

Edit: This post was recovered from search engine cache.