WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : This provides a drop down form for searching with different search engines. All the encoding/arguments are set by the program as need for each supported search engine (currently 18)
Categories : HTML, Search Update Picture
Fraser Cambpell
Date : Jan 17th 1999
Grade : 4 of 5 (graded 2 times)
Viewed : 6070
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Fraser Cambpell
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?
##########################################################################
# Internet Search with PHP #
# Fraser Campbell, October 10, 1998 #
# fraser@greynet.net #
# http://www.greynet.net/fraser/ #
##########################################################################
# To use this, save this file as search.php3 in your #
# html directory or somewhere on your server where #
# everyone can use it -- your web server must #
# support PHP3. Use the program by sticking the #
# form below in any of your webpages. I will add #
# more search engines as time permits. #
##########################################################################

#<FORM ACTION="search.php3">
# <INPUT TYPE="text" NAME="SearchString" size="18" VALUE="">
# <SELECT NAME="SearchEngine">
# <OPTION VALUE="Altavista">Search with Altavista
# <OPTION VALUE="Altavista Canada">Search with Altavista Canada
# <OPTION VALUE="Dogpile">Search with Dogpile
# <OPTION VALUE="Excite">Search with Excite
# <OPTION VALUE="Google">Search with Google
# <OPTION VALUE="Goto">Search with Goto
# <OPTION VALUE="HotBot">Search with HotBot
# <OPTION VALUE="Infoseek">Search with Infoseek
# <OPTION VALUE="Inference Find">Search with Inference Find
# <OPTION VALUE="Looksmart">Search with Looksmart
# <OPTION VALUE="Lycos">Search with Lycos
# <OPTION VALUE="Magellan">Search with Magellan
# <OPTION VALUE="Metacrawler">Search with Metacrawler
# <OPTION VALUE="Snap">Search with Snap
# <OPTION VALUE="Starting Point">Search with Starting Point
# <OPTION VALUE="Webcrawler">Search with Webcrawler
# <OPTION VALUE="Yahoo">Search with Yahoo
# <OPTION VALUE="Yahoo Canada">Search with Yahoo Canada
# </SELECT>
# <INPUT TYPE="text" NAME="SearchString" size="18" VALUE="">
# <INPUT TYPE="submit" VALUE="Find!">
#</FORM>

$SearchString = urlencode($SearchString);

if ($SearchEngine == "Altavista") {
if ($SearchString == "") {
Header( "Location: http://www.altavista.com/");
exit;
} else {
Header( "Location: http://www.altavista.com/cgi-bin/query?pg=q&what=web&q=$SearchString");
exit;
}
} else if ($SearchEngine == "Altavista Canada") {
if ($SearchString == "") {
Header( "Location: http://www.altavista.ca/");
exit;
} else {
Header( "Location: http://www.altavista.ca/cgi-bin/query?pg=q&what=web&q=$SearchString");
exit;
}
} else if ($SearchEngine == "Dogpile" ) {
if ($SearchString == "") {
Header( "Location: http://www.dogpile.com/");
exit;
} else {
Header( "Location: http://buck.dogpile.com/texis/search?q=$SearchString&fs=web&ss=stop&to=ten");
exit;
}
} else if ($SearchEngine == "Excite" ) {
if ($SearchString == "") {
Header( "Location: http://www.excite.com/");
exit;
} else {
Header( "Location: http://www.excite.com/search.gw?search=$SearchString");
exit;
}
} else if ($SearchEngine == "Google" ) {
if ($SearchString == "") {
Header( "Location: http://google.stanford.edu/");
exit;
} else {
Header( "Location: http://google.stanford.edu/search?num=20&query=$SearchString");
exit;
}
} else if ($SearchEngine == "Goto" ) {
if ($SearchString == "") {
Header( "Location: http://www.goto.com/");
exit;
} else {
Header( "Location: http://www.goto.com/d/search/?Keywords=$SearchString");
exit;
}
} else if ($SearchEngine == "HotBot" ) {
if ($SearchString == "") {
Header( "Location: http://www.hotbot.com/");
exit;
} else {
Header( "Location:
http://www.hotbot.com/?MT=$SearchString&SM=B&DV=0&LG=any&RD=RG&DC=10&DE=2&_v=2&OPs=MDRTP");
exit;
}
} else if ($SearchEngine == "Inference Find" ) {
if ($SearchString == "") {
Header( "Location: http://www.infind.com/");
exit;
} else {
Header( "Location: http://www.infind.com/infind/infind.exe?time=10&query=$SearchString");
exit;
}
} else if ($SearchEngine == "Infoseek" ) {
if ($SearchString == "") {
Header( "Location: http://www.infoseek.com/");
exit;
} else {
Header( "Location: http://www.infoseek.com/Titles?col=WW&qt=$SearchString");
exit;
}
} else if ($SearchEngine == "Looksmart" ) {
if ($SearchString == "") {
Header( "Location: http://www.looksmart.com/");
exit;
} else {

Header( "Location: http://www.looksmart.com/r_search?look=&key=$SearchString");
exit;
}
} else if ($SearchEngine == "Lycos" ) {
if ($SearchString == "") {
Header( "Location: http://www.lycos.com/");
exit;
} else {

Header( "Location: http://www.lycos.com/cgi-bin/pursuit?cat=lycos&query=$SearchString");
exit;
}
} else if ($SearchEngine == "Magellan" ) {
if ($SearchString == "") {
Header( "Location: http://www.mckinley.com/");
exit;
} else {
Header( "Location: http://www.mckinley.com/search.gw?c=web&search=$SearchString");
exit;
}
} else if ($SearchEngine == "Metacrawler" ) {
if ($SearchString == "") {
Header( "Location: http://www.metacrawler.com/");
exit;
} else {
Header( "Location: http://www.metacrawler.com/crawler?general=$SearchString");
exit;
}
} else if ($SearchEngine == "Snap" ) {
if ($SearchString == "") {
Header( "Location: http://www.snap.com/");
exit;
} else {
Header( "Location:
http://home.snap.com/search/directory/results/1,61,home-0,00.html?tag=st.sn.fdsb&keyword=$SearchString");
exit;
}
} else if ($SearchEngine == "Yahoo" ) {
if ($SearchString == "") {
Header( "Location: http://www.yahoo.com/");
exit;
} else {
Header( "Location: http://search.yahoo.com/bin/search?p=$SearchString&name=Search");
exit;
}
} else if ($SearchEngine == "Starting Point" ) {
if ($SearchString == "") {
Header( "Location: http://www.stpt.com/");
exit;
} else {
Header( "Location:
http://www.stpt.com/cgi-bin/pwrsrch/searchDirect.cgi?query=$SearchString&search=web");
exit;
}
} else if ($SearchEngine == "Webcrawler" ) {
if ($SearchString == "") {
Header( "Location: http://www.webcrawler.com/");
exit;
} else {
Header( "Location: http://www.webcrawler.com/cgi-bin/WebQuery?searchText=$SearchString");
exit;
}
} else if ($SearchEngine == "Yahoo" ) {
if ($SearchString == "") {
Header( "Location: http://www.yahoo.com/");
exit;
} else {
Header( "Location: http://search.yahoo.com/bin/search?p=$SearchString");
exit;
}
} else if ($SearchEngine == "Yahoo Canada" ) {
if ($SearchString == "") {
Header( "Location: http://www.yahoo.ca/");
exit;
} else {
Header( "Location: http://search.yahoo.ca/search?x=canada&p=$SearchString");
exit;
}
}
?>



Show or Hide your Content using Javascript
Categories : Java Script, HTML, CSS, Beginner Guides
Higly Customizable Javascript Calendar Script
Categories : Java Script, Calendar, Date Time, HTML, CSS
Add Boolean Logic Functions to Database Queries Easily. A function to write a WHERE clause dynamically to search a database from a search form.
Categories : MySQL, PHP, Search
How to know which input button of type image was pressed in a form with multiple image buttons (_x and _y) in PHP?
Categories : PHP, Variables, HTML
CachedFastTemplate class, extends CDI's FastTemplate to allow page caching
Categories : HTML and PHP, HTML, PHP Classes
Local search engine that can be used to index pages that are static HTML and dynamically generated using script and database
Categories : Search
How to preset a text string in a textarea input field
Categories : HTML, HTML and PHP, PHP, Beginner Guides
showing Help (assistance) to the user while filling html forms.
Categories : HTML, Java Script, Form Processing
How to use regular expressions to get the list of links from an HTML page
Categories : PHP, Regexps, HTML, HTML and PHP
How to get the source of a site into an array.
Categories : Arrays, HTML, PHP
BBCode Formatting String
Categories : PHP, HTML, Regexps, Arrays
Dynamic Menu/Site Navigation Script in Perl
Categories : Perl, Site Planning, HTML
Enchancing dd/mm/yyyy forms with unobtrusive javascript
Categories : Java Script, HTML, User Interface, Date Time
Conditional Check - a script that allows a user to submit a form only if the user check a checkbox.
Categories : HTML, Java Script, Form Processing, Beginner Guides
How to build a search query for any N number of words in a search string
Categories : PHP, Regexps, Search Engines, Search