
12-15-03, 01:41 PM
|
|
Newbie Coder
|
|
Join Date: Dec 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
|
Corrected Script
Sorry, leme try again....
PHP Code:
<?php
# -----------------------------------------------------------------------------------------------------------------
# Application: MP3 Search Engine Jump Form
# Written by: Geoff A. Virgo, March 2000
# Revised by: Geoff A. Virgo, February 2001
# Email: [email]gvirgo@mithril.com[/email]
# Webpage: [url]www.mithril.com[/url]
# License: Lesser GNU Public License
#
# Your's to use as you will, but don't blame me if your computer bursts into flames!!:) You may re-distribute this
# library as you see fit as long as this section of the header remains intact.
# ------------------------------------------------------------------------------------------------------------------
#
# ----------------------------------------
# Filename: mp3_search_engine.php
# ----------------------------------------
#
# This is a small application which displays a form allowing the input of a search query and choice of 20 popular
# search engines. The application takes the submitted query, formats it, and passes it on to the search engine.
#
# Useage:
#
# Edit the ACTION and TARGET directives in the form found in searchEngineForm() to the your specifications.
# The default action is 'search_results.php' and the default target is '_blank' (a new window). Place an
# include() or require call to this file on the page you wish to display the form from and on the page the
# form calls onsubmission.
#
# To display the form make the following call:
#
# mp3SearchEngineForm();
#
# To execute the search, make the following call:
#
# executeMP3Search($query_string, $engine,$HTTP_POST_VARS);
#
#
# Function Reference:
#
# void mp3SearchEngineForm();
#
# - produces and displays the search form
#
# void executeMP3Search(string query_string, string name_ofsearch_engine, array posted_variables);
#
# - accepts three strings as arguments; one containing the search string, one containing the name of the engine to
# apply to the search on, and the environment variable HTTP_POST_VARS
# - formats query string and redirects to the selected search engine
#
// declare function which produces the mp3 search egnine form
function mp3SearchEngineForm() {
?>
<form target = '_blank' action = 'search_results.php' method = "post">
<center><table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" >
<tr>
<td>
<center>
<table CELLSPACING=0 CELLPADDING=0 WIDTH="100%" >
<tr>
<td>
<br>
<center>
<p>
Search for:
<input TYPE="text" NAME="query_string" size = "40" VALUE="">
<input TYPE="submit" size = "10" name = "submit" VALUE="Find It!">
<input type = "reset" value = " Reset ">
</center>
<p>
<br>
<center>
<table WIDTH="96%" >
<tr>
<td>
The following list of MP3 search engines is based on the Top 30 list found at <a target = '_blank' href="http://www.mp3now.com/html/mp3_search.html">MP3Now</a>. I will try to keep the list as current as possible, but you know how it goes:) To go directly to one of the sites listed below, check the radio button and click <Find It!> with the search field empty.
</td>
</tr>
</table>
</center>
<p>
Search Engines 1 -10:
<center>
<table BORDER COLS=1 WIDTH="95%" BGCOLOR="#990000" >
<tr>
<td>
<center>
<table COLS=2 WIDTH="100%" BGCOLOR="#CCCCCC" >
<tr>
<td WIDTH="5%">
<center><b><font color="#000000">1</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="Palavista" checked>
<b>
<font color="#000000">Palavista.com</font></b>
<br>
<b><font face="Arial, Western" color="#000000" size=-2>
Search Type
<select name="type" size="1" >
<option selected value=default.html>http and ftp</option>
<option value=clickable.html>http only</option>
</select>
Min. % Revelence to Query <select name="rel" size="1" >
<option value=10>10%</option>
<option value=20>20%</option>
<option value=30>30%</option>
<option value=40>40%</option>
<option value=50>50%</option>
<option value=60>60%</option>
<option value=70>70%</option>
<option selected value=80>80%</option>
<option value=90>90%</option>
</select>
Max # of hits returned
<select name="max_hits" size="1" >
<option selected value=50>50</option>
<option value=75>75</option>
<option value=100>100</option>
<option value=150>150</option>
<option value=200>200</option></select>
</font></b>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">2</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="MP3Board">
<b><font color="#000000">MP3Board.com </font></b>
<br><b><font face="Arial, Western" color="#000000" size=-2> Search:
<input type="radio" name="subcat_mp3board" VALUE="http" checked>HTTP Servers
<input type="radio" name="subcat_mp3board" VALUE="ftp">FTP Servers
<input type="radio" name="subcat_mp3board" VALUE="movie">Movie Servers
</font></b>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">3</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="SeekMP3"><b><font color="#000000">SeekMP3.com </font></b>
<br>
<b><font face="Arial, Western" color="#000000" size=-2> Search:
<input type="radio" name="subcat_seekmp3" VALUE="http" checked>HTTP Servers
<input type="radio" name="subcat_seekmp3" VALUE="ftp">FTP Servers
</font></b>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">4</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="AudioFind"><b><font color="#000000">AudioFind.com</font></b>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">5</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="Oth"><b><font color="#000000">Kermit/Oth.net</font></b>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">6</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="MP3Lycos"><b><font color="#000000">MP3Lycos.com</font></b>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">7</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="MediaTrak"><b><font color="#000000">MediaTrack</font></b>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">8</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="Astraweb"><b><font color="#000000">MP3Search.Astraweb.com</font></b>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">9</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="MP3Box"><b><font color="#000000">MP3.Box.sk</font></b>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">10</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="MP3_Box"><b><font color="#000000">Scour.net</font></b>
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>
</center>
<p>
<font color="#000066"> Search Engines 11 - 20:</font>
<center>
<table BORDER COLS=1 WIDTH="95%" BGCOLOR="#990000" >
<tr>
<td>
<center>
<table COLS=2 WIDTH="100%" BGCOLOR="#CCCCCC">
<tr>
<td WIDTH="5%">
<center>
<b>
<font color="#000000">11</font>
</b>
</center>
</td>
<td>
<input type="radio" name="engine" VALUE="MP3Meta"><b><font color="#000000">MP3meta.com</font></b>
<br>
<b>
<font face="Arial, Western" color="#000000" size=-2>
Search for:
<input type="radio" name="subcat_mp3meta" VALUE="mp3s" checked>mp3's
<input type="radio" name="subcat_mp3meta" VALUE="lyrics">lyrics
</font>
</b>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">12</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="MP3Site"><b><font color="#000000">MP3Site.com</font></b>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">13</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="gigabeat"><b><font color="#000000">GigaBeat.com</font></b>
<br>
<font face="Arial, Western" color="#000000" size=-2>
<input type="radio" name="subcat_gigabeat" VALUE="unverified" checked>return all links
<input type="radio" name="subcat_gigabeat" VALUE="verified">return only links alive in last 24 hours</font>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">14</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="jugalug"><b><font color="#000000">Jugalug.com</font></b>
<br>
<b>
<font face="Arial, Western" color="#000000" size=-2> Search: 
<input type="radio" name="subcat_jugalug"VALUE="both" checked>All Servers;
<input type="radio" name="subcat_jugalug" VALUE="http">HTTP Servers
<input type="radio" name="subcat_jugalug" VALUE="ftp">FTP Servers
</font>
</b>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">15</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="2look4"><b><font color="#000000">2look4.com
- FTP Sites Only</font></b>
<br><b><font face="Arial, Western" color="#000000" size=-2> Search:
<input type="radio" name="subcat_2look4" VALUE="all" checked>All Sites
<input type="radio" name="subcat_2look4" VALUE="reliable">Reliable Sites
<input type="radio" name="subcat_2look4" VALUE="non_ratio">Non-RatioSites
<input type="radio" name="subcat_2look4" VALUE="reliable_non_ratio">Reliable Non-Ratio Sites
</font>
</b>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">16</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="AIRMP3"><b><font color="#000000">AIRMP3.com</font></b>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">17</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="FileQuest">
<b>
<font color="#000000">FilesQuest.com - requires the <a href="http://www.filequest.com/simba/Simba104.zip">Simba Downloader</a>
</font>
</b>
<br>
<b>
<font face="Arial, Western" color="#000000" size=-2> Search:
<input type="radio" name="subcat_filequest2" VALUE="all" checked>All Servers
<input type="radio" name="subcat_filequest2" VALUE="http">HTTP Servers
<input type="radio" name="subcat_filequest2" VALUE="smb">SMB Servers
</font>
</b>
<br>
<b>
<font face="Arial, Western" color="#000000" size=-2> Search Options:
<input type="radio" name="subcat_filequest1" VALUE="any" checked>Any words in string
<input type="radio" name="subcat_filequest1" VALUE="all">All words in string
</font>
</b>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">18</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="TheSeek"><b><font color="#000000">TheSeek.com</font></b>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">19</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="Acid"><b><font color="#000000">AcidSearch.com</font></b>
</td>
</tr>
<tr>
<td>
<center><b><font color="#000000">20</font></b></center>
</td>
<td>
<input type="radio" name="engine" VALUE="cybertropix">
<b>
<font color="#000000">Cybertropix<font face="Arial, Western" size=-2>
How many hits would you like returned?
<select name="hits" size="1" >
<option selected value=50>50</option>
<option value=100>100</option>
<option value=150>150</option>
<option value=200>200</option>
<option value=250>250</option>
<option value=300>300</option>
</select>
</font>
</b>
</form>
</td>
</tr>
</table>
</center>
</td>
</tr>
</table>
</center>
<br>
</td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
</center>
<p>
<?php
}
// declare the function which formats the search string and passes it
// to the selected search engine
function executeMP3Search($query_string,$engine,$HTTP_POST_VARS) {
// format query string
$query_string = stripslashes($query_string);
// begin selection to determine the searh engine requested
switch($engine) {
// if Palavista
case "Palavista":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://www.palavista.com/";
break;
// if the query string is not empty
default:
$redirect_url = "http://www.palavista.com/cgi-bin/burgandy.pl?template=" . $HTTP_POST_VARS[type];
$redirect_url .= "&minrel=" . $HTTP_POST_VARS[rel] . "&maxhit=" . $HTTP_POST_VARS[max_hits] . "&query=$query_string";
break;
}
break;
case "MP3Board":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://www.mp3board.com/";
break;
// if the query string is not empty
default:
// create the redirection string based on the selected options
switch($HTTP_POST_VARS[subcat_mp3board]) {
// search http sites
case "http":
$redirect_url = "http://www.mp3board.com/ddsearch.smx?search=$query_string";
break;
// search ftp sites
case "ftp":
$redirect_url = "http://www.mp3board.com/search.smx?search=$query_string";
break;
// search movies sites
case "movie":
$redirect_url = "http://www.mp3board.com/dustcloud.html?search=$query_string";
break;
// the default is search http sites
default:
$redirect_url = "http://www.mp3board.com/ddsearch.smx?search=$query_string";
break;
}
}
break;
case "SeekMP3":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://www.seekmp3.com/";
break;
// if the query string is not empty
default:
// create the redirection string based on the selected options
switch($HTTP_POST_VARS[subcat_seekmp3]) {
// search http sites
case "http":
$redirect_url = "http://www.seekmp3.com/http_search/search.cgi?type=search&search=$query_string";
break;
// search ftp sites
case "ftp":
$redirect_url = "http://www.seekmp3.com/cgi-bin/ftp/search.cgi?search=$query_string";
break;
// the default is search http sites
default:
$redirect_url = "http://www.seekmp3.com/http_search/search.cgi?type=search&search=$query_string";
break;
}
}
break;
case "AudioFind":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://www.audiofind.com/";
break;
// if the query string is not empty
default:
$redirect_url = "http://206.132.245.136:70/?audiofindsize=0&audiofindsearch=$query_string&x=32&y=8";
break;
}
break;
case "Oth":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://oth.net/";
break;
// if the query string is not empty
default:
$redirect_url = "http://www.Oth.Net/cgi-bin/search?q=$query_string&cl=1";
break;
}
break;
case "MP3Lycos":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://mp3.lycos.com/";
break;
// if the query string is not empty
default:
$redirect_url = "http://mp3.lycos.com/cgi-bin/search?form=lycosnet&query=$query_string";
break;
}
break;
case "Astraweb":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://mp3search.astraweb.com/";
break;
// if the query string is not empty
default:
$redirect_url = "http://mp3search.astraweb.com/cgi-bin/search.cgi?word=$query_string";
break;
}
break;
case "MediaTrak":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://www.pearlmagik.com/mediatrak/";
break;
// if the query string is not empty
default:
$redirect_url = "http://www.pearlmagik.com/mediatrak/search.cgi?query=$query_string";
break;
}
break;
case "MP3Box":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://mp3.box.sk/";
break;
// if the query string is not empty
default:
$redirect_url = "http://mp3.box.sk/mp3ftp.php3?srch=$query_string&submit=+search+";
break;
}
break;
case "Scour":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://www.scour.net/";
break;
// if the query string is not empty
default:
$redirect_url = "http://www.scour.net/Search/Search.phtml?protocol=all&index=audio&query=$query_string";
break;
}
break;
case "MP3Meta":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://www.mp3meta.com/";
break;
// if the query string is not empty
default:
// create the redirection string based on the selected options
switch($HTTP_POST_VARS[subcat_mp3meta]) {
// search for mp3's
case "mp3s":
$redirect_url = "http://www.mp3meta.com/search?partner=mp3meta&cat=74&q=$query_string";
break;
// search for lyrics
case "lyrics":
$redirect_url = "http://www.mp3meta.com/search?partner=mp3meta&cat=32&q=$query_string";
break;
// the default is an mp3 search
default:
$redirect_url = "http://www.mp3meta.com/search?partner=mp3meta&cat=74&q=$query_string";
break;
}
break;
}
break;
case "MP3Site":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://www.mp3site.com/";
break;
// if the query string is not empty
default:
$redirect_url = "http://search.mp3site.com/search.php?searchString=$query_string";
break;
}
break;
case "gigabeat":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://www.gigabeat.com/";
break;
// if the query string is not empty
default:
echo $HTTP_POST_VARS[subcat_gigabeat] . "<br>";
// create the redirection string based on the selected options
switch($HTTP_POST_VARS[subcat_gigabeat]) {
// if show verified and unverified hits
case "unverifed":
$redirect_url = "http://www.gigabeat.com/cgi-bin/searchMP3.cgi?st=mp3&q=$query_string";
break;
// show only verified hits
case "verified":
$redirect_url = "http://www.gigabeat.com/cgi-bin/searchMP3.cgi?st=mp3&q=$query_string&lo=1";
break;
// the default is to show verified and unverified hits
default:
$redirect_url = "http://www.gigabeat.com/cgi-bin/searchMP3.cgi?st=mp3&q=$query_string";
break;
}
break;
}
break;
case "jugalug":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://www.jugalug.com/";
break;
// if the query string is not empty
default:
// create the redirection string based on the selected options
switch($HTTP_POST_VARS[subcat_jugalug]) {
// search only http sites
case "http":
$redirect_url = "http://www.jugalug.com/juggies/nph-jugalug.jug?http=on&terms=$query_string";
break;
// search only ftp sites
case "ftp":
$redirect_url = "http://www.jugalug.com/juggies/nph-jugalug.jug?ftp=on&terms=$query_string";
break;
// search both http and ftp sites
case "both":
$redirect_url = "http://www.jugalug.com/juggies/nph-jugalug.jug?http=on&ftp=on&terms=$query_string";
break;
// default is to search both http and ftp sites
default:
$redirect_url = "http://www.jugalug.com/juggies/nph-jugalug.jug?http=on&ftp=on&terms=$query_string";
break;
}
break;
}
break;
case "2look4":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://www.2look4.com/";
break;
// if the query string is not empty
default:
// create the redirection string based on the selected options
switch($HTTP_POST_VARS[subcat_2look4]) {
// search only reliable sites
case "reliable":
$redirect_url = "http://www.2look4.com/cgi-bin/mp3/search.cgi?query=$query_string&sites=r";
break;
// search only non-ratio sites
case "non_ratio":
$redirect_url = "http://www.2look4.com/cgi-bin/mp3/search.cgi?query=$query_string&sites=n";
break;
// search only reliable, non-ratio sites
case "reliable_non_ratio":
$redirect_url = "http://www.2look4.com/cgi-bin/mp3/search.cgi?query=$query_string&sites=z";
break;
// default is to search all sites
default:
$redirect_url = "http://www.2look4.com/cgi-bin/mp3/search.cgi?query=$query_string&sites=a";
break;
}
break;
}
break;
case "AIRMP3":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://www.airmp3.com/";
break;
// if the query string is not empty
default:
$redirect_url = "http://www.airmp3.com/list.shtml?type=search&terms=$query_string";
break;
}
break;
case "FileQuest":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://www.filequest.com/";
break;
// if the query string is not empty
default:
// create the redirection string based on the selected options
switch($HTTP_POST_VARS[subcat_filequest1]) {
// match on any of the words in the query string
case "any":
$redirect_url = "http://www.filequest.com/search/search.phtml?andsearch=0&query=";
$redirect_url .= "&SearchString&index=audio&protocol=" . $HTTP_POST_VARS[subcat_filequest2];
break;
// match on all of the words in the query string
case "all":
$redirect_url = "http://www.filequest.com/search/search.phtml?andsearch=1&query=$SearchSting&index=audio&protocol=";
$redirect_url .= $HTTP_POST_VARS[subcat_filequest2];
break;
}
break;
}
break;
case "TheSeek":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://www.theseek.com/";
break;
// if the query string is not empty
default:
$redirect_url = "http://www.theseek.com/search.php3?mp3query=$query_string";
break;
}
break;
case "Acid":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://www.acidsearch.com/";
break;
// if the query string is not empty
default:
$redirect_url = "http://www.acidsearch.com/search/view.phtml?query=$query_string";
break;
}
break;
case "cybertropix":
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://search.cybertropix.net/?";
break;
// if the query string is not empty
default:
$redirect_url = "http://search.cybertropix.com/index.phtml?timeout=5&template=default&query=$query_string&source=mp3&";
$redirect_url .= "max=" . $HTTP_POST_VARS[hits];
break;
}
break;
// the default search engine is Palavista
default:
// create the redirection string based on whether the query string is empty or not
switch($query_string) {
// if the query string is empty
case "":
$redirect_url = "http://www.palavista.com/";
break;
// if the query string is not empty
default:
$redirect_url = "http://www.palavista.com/cgi-bin/burgandy.pl?template=" . $HTTP_POST_VARS[type];
$redirect_url .= "&minrel=" . $HTTP_POST_VARS[rel] . "&maxhit=" . $HTTP_POST_VARS[max_hits] . "&query=$query_string";
break;
}
break;
}
header("Location: $redirect_url");
}
?>
Kind Regards
skipper23
|