I run a summer camp blog/forum and would like to offer a cool search box for my users with a text input for their search string, a "go" button to tell it to search, and then a few radial buttons just below it that control what kind of search the user is performing. I'd like the user to be able to search my blog, my forums, my wiki, or my photo galleries. These are all separate databases and every one of these sections has its own search function, I'd just like to collect them all together for the user to choose from on the front page. My problem however is that I can't seem to figure out exactly what happens when you use a form. When a user hits "submit" are they sending out a hyperlink? something else? Where can I see this hyperlink? What attribute would tell each of these radial buttons where to search? I'm also interested in this because I'd like to be able to add a link to some text that when clicked would perform a specific search or sorting function. again, I don't understand though how to see the information being sent out by a form so I can insert this info in a hyperlink around some text. Could someone explain this briefly, where I should look to find this elusive info? Perhaps there's a really good tutorial online about how to set up exactly this sort of multiple choice search box? Thanks!
I would recommend reading up at http://www.w3schools.com, but here it is in a nutshell: Forms have an "action" attribute, and when an input with an attribute of "submit" is activated, that action is taken. For example: <form action="form_action.asp" method="get"> <input type="submit" value="Submit" /> </form> Code (markup): In this case, there will only be a submit button, and when it is clicked, it will run an ASP script named form_action. The script doesn't have to be ASP, it can be PHP, Perl, Python, Java, or whatever. What the script does is entirely up to you, since you will have to write it. In the case of your multiple search types, you would write a script that ran a search of the various SQL tables (assuming your DB is SQL) and return the results. There are thousnads of tutorials for learning the dozens of different scripting languages, and hundreds of tutorials on writing scripts that search a DB for each language. You need to figure out which languages your server supports, learn enough about that language that you can start writing scripts, then learn how to interface that language with your database type. It won't be a short road, and it won't be an easy road, but it will be educational! My advice would be to sign up for Google Adsense, then place a Google site search box on your site. It won't allow users to only search your wiki, or your forum, or what not, but it will take a day to set up as opposed to a year or more of heavy learning. Plus, it will help you get a bit of revenue, which is always a good thing.