ahs10 Posted July 31, 2007 Share Posted July 31, 2007 i got the script below online, but it isn't working for me. even the demo does not work, when you submit the form it goes to the php page and the browser just loads it over and over again. it is supposed to allow you to search multiple search engines via one form. could someone please help me to get this script working please? php..... <? # search engine processor script # # scpt: multisearch.php # # devl: www.blazonry.com # # date: july 1st, 1999 # # desc: multiple search engine in one Form # # Receives engine ($engine) and search criteria ($scrit) # from a form and creates the proper search form and # submits it to the site specified # # * Works with GET or POST method # * Any amount of hidden fields # DEFINE SEARCH ENGINES # engine name = action, method, criteria field $engines = array( "excite" => array("http://www.excite.com/search.gw", "GET", "search"), "altavista" => array("http://www.altavista.com/cgi-bin/query", "GET", "q"), "webster" => array("http://www.m-w.com/cgi-bin/dictionary", "POST", "va"), "yahoo" => array("http://search.yahoo.com/bin/search","GET","p"), "internic" => array("http://www.networksolutions.com/cgi-bin/whois/whois","POST","STRING"), "google" => array("http://www.google.com/search","GET","q"), "devsearch" => array("http://www.devsearch.com/cgi-bin/query","GET","q"), "det" => array("http://www.etrade.com/cgi-bin/gx.cgi/AppLogic+ResearchSymbol","POST","research_quote_symbol"), "hotbot" => array("http://www.hotbot.com/","GET","MT"), "lycos" => array("http://www.lycos.com/cgi-bin/pursuit","GET","query"), "askjeeves" => array("http://www.askjeeves.com/main/askJeeves.asp","GET","ask"), "slashdot" => array("http://www.slashdot.org/search.pl","GET","query"), "freshmeat" => array("http://core.freshmeat.net/search.php3","POST","query"), "php" => array("http://www.php.net/manual-lookup.php3", "POST", "function"), "infind" => array("http://www.infind.com/infind/infind.exe","GET","query") ); # DEFINE HIDDEN FIELDS # engine name = "name"=>"value" $hiddenfields = array( "altavista" => array("pg"=>"q","what"=>"web","kl"=>"en"), "webster" => array("book"=>"dictionary"), "devsearch" => array("mss"=>"en/simple", "pg"=>"q", "what"=>"web", "enc"=>"iso88591","fmt"=>".","op"=>"a"), "det" => array("INFOTYPE"=>"DET_QUOTES"), "hotbot" => array("OPs"=>"MDRTP"), "lycos" => array("cat"=>"dir"), "askjeeves" => array("origin"=>"","qSource"=>"0","site_name"=>"Jeeves","metasearch"=>"yes"), "infind" => array("time"=>"10") ); $action = $engines[$engine][0]; $method = $engines[$engine][1]; $criteriafield = $engines[$engine][2]; ?> <form name="theForm" action="<?php echo($action); ?>" METHOD="<?php echo($method) ?>"> <input type="hidden" name="<?php echo($criteriafield); ?>" VALUE="<?php echo($scrit); ?>"> <? if ($hiddenfields[$engine]) { while ( list($key, $val) = each($hiddenfields[$engine]) ) { echo "<INPUT TYPE='hidden' NAME='$key' VALUE='$val'>\n"; } } ?> </form> <script> document.theForm.submit(); </script> the form in the html page.... <form name="search" action="multisearch_ex.php" method="POST"> <table> <tr><td><b>Search Using:</b></td> <td><select name="engine"> <option value="0">Select Search Tool <option value="altavista">AltaVista <option value="askjeeves">Ask Jeeves <option value="devsearch">DevSearch <option value="excite">Excite <option value="freshmeat">Freshmeat.net <option value="google">Google <option value="hotbot">HotBot <option value="infind">Inference Infind <option value="lycos">Lycos <option value="php">PHP Manual QuickRef <option value="slashdot">Slashdot.org <option value="yahoo">Yahoo! <option value="webster">Webster Dictionary <option value="internic">Internic Whois </select> </td></tr> <tr><td><b>Criteria:</b></td><td><input type="text" name="scrit" value="" size="20"></td></tr> <tr><td colspan="2"><input type="submit" value="submit"></td></tr> </table> </form> Quote Link to comment https://forums.phpfreaks.com/topic/62739-multiple-search-engine-in-one-form/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.