Current location: Hot Scripts Forums » Programming Languages » PHP » Declared Functions

Declared Functions

 
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 12-16-03, 11:46 AM
skipper23 skipper23 is offline
Newbie Coder
 
Join Date: Dec 2003
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Declared Functions

I posted before about the index.php not showing up, and thank you who responded. But like I said before I am new to php and I don't have a clue how to declared functions. If someone can give me some pointers I would greatly appriciate it. The code does state they are needed, but where and in what sequence?.....
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:&nbsp;
                        <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>
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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>.&nbsp;&nbsp; I will try to keep the list as current as possible, but you know how it goes:)&nbsp; To go directly to one of the sites listed below, check the radio button and click &lt;Find It!> with the search field empty.
                                </td>
                            </tr>
                        </table>
                        </center>
                        <p>
                        &nbsp;&nbsp;&nbsp; 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>
                                            &nbsp;&nbsp;&nbsp;&nbsp; Search Type&nbsp;
                                            <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&nbsp;<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&nbsp;
                                            <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&nbsp;</font></b>
                                            <br><b><font face="Arial, Western" color="#000000" size=-2>&nbsp;&nbsp;&nbsp;&nbsp;Search:
                                            <input type="radio" name="subcat_mp3board" VALUE="http" checked>HTTP Servers&nbsp;
                                            <input type="radio" name="subcat_mp3board" VALUE="ftp">FTP Servers&nbsp;
                                            <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&nbsp;</font></b>
                                            <br>
                                            <b><font face="Arial, Western" color="#000000" size=-2>&nbsp;&nbsp;&nbsp;&nbsp;Search:
                                            <input type="radio" name="subcat_seekmp3" VALUE="http" checked>HTTP Servers&nbsp;
                                            <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">&nbsp;&nbsp;&nbsp; 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>&nbsp;&nbsp;&nbsp;&nbsp;
                                Search for:
                                <input type="radio" name="subcat_mp3meta" VALUE="mp3s" checked>mp3's&nbsp;
                                <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>&nbsp;&nbsp;&nbsp;&nbsp;
                                <input type="radio" name="subcat_gigabeat" VALUE="unverified" checked>return all links&nbsp;
                                <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>&nbsp;&nbsp;&nbsp;&nbsp;Search:&nbsp
                                <input type="radio" name="subcat_jugalug"VALUE="both" checked>All Servers;&nbsp;
                                <input type="radio" name="subcat_jugalug" VALUE="http">HTTP Servers&nbsp;
                                <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>&nbsp;&nbsp;&nbsp;&nbsp; Search:&nbsp;
                                <input type="radio" name="subcat_2look4" VALUE="all" checked>All Sites&nbsp;
                                <input type="radio" name="subcat_2look4" VALUE="reliable">Reliable Sites&nbsp;
                                <input type="radio" name="subcat_2look4" VALUE="non_ratio">Non-RatioSites&nbsp;
                                <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>&nbsp;&nbsp;&nbsp;&nbsp;Search:&nbsp;
                                <input type="radio" name="subcat_filequest2" VALUE="all" checked>All Servers&nbsp;
                                <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>&nbsp;&nbsp;&nbsp;&nbsp;Search Options:
                                <input type="radio" name="subcat_filequest1" VALUE="any" checked>Any words in string&nbsp;
                                <input type="radio" name="subcat_filequest1" VALUE="all">All words in string&nbsp;
                                </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>&nbsp;&nbsp;&nbsp;&nbsp;
                                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>&nbsp;
    </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&nbsp;
                            
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Err I know what I want but dont know what the functions called. DAL JavaScript 1 11-28-03 03:16 PM
VBscript... math functions and stuff that hurts my brain. Mister B. ASP 0 08-31-03 02:04 PM
Array passing between functions alfreds PHP 1 08-25-03 06:29 AM
Optimizing functions amidamaru PHP 7 08-08-03 06:56 PM
Need more functions for my wysiwyg editor klausre PHP 3 06-14-03 12:35 PM


All times are GMT -5. The time now is 03:59 AM.
vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.