Computing.Net > Forums > Web Development > Search Engine Script

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Search Engine Script

Reply to Message Icon

Name: erussell
Date: October 8, 2009 at 21:22:50 Pacific
OS: Windows XP
Subcategory: General
Tags: search engine, script, website
Comment:

I am looking for a simple script search engine which uses database files.
All I really need is an input field with a drop down menu. I need the drop down menu to select a specific database file to search.

The idea is to enter a product description to search, and what type of product catagory to search.

Any help would be greatly apreciated.



Sponsored Link
Ads by Google

Response Number 1
Name: Radix-64
Date: October 9, 2009 at 07:28:19 Pacific
Reply:

Hi, perhaps some PHP code with something like this might help you achieve your goals.

For the user search form to select/search the database from your site:

<h2>Search</h2>
<form name="search" method="post" action="<?=$PHP_SELF?>">
Seach for: <input type="text" name="find" /> in
<Select NAME="field">
<Option VALUE="db1">db1</option>
<Option VALUE="db2">db2</option>
<Option VALUE="db3">db3</option>
</Select>
<input type="hidden" name="searching" value="yes" />
<input type="submit" name="search" value="Search" />
</form>

Here's the code to perform the actual search against your database.

<?
if ($searching =="yes")
{
echo "<h2>Search Results</h2>";

if ($find == "")
{
echo "

Enter a search term";
exit;
}

mysql_connect("mysql.yourhost.com", "user_name", "password") or die(mysql_error());
mysql_select_db("database_name") or die(mysql_error());

$find = strtoupper($find);
$find = strip_tags($find);
$find = trim ($find);

$data = mysql_query("SELECT * FROM users WHERE upper($field) LIKE'%$find%'");

while($result = mysql_fetch_array( $data ))
{
echo $result['db1'];
echo " ";
echo $result['db2'];
echo " ";
echo $result['db3'];
echo " ";
echo " ";
}

$anymatches=mysql_num_rows($data);
if ($anymatches == 0)
{
echo "No database match";
}
echo "Search Terms" .$find;
}
?>


2

Response Number 2
Name: erussell
Date: October 9, 2009 at 09:18:00 Pacific
Reply:

this will be tricky but i think it should work. I will have to self learn myself the basics of PHP but it appears to be very much what i am looking for.

Thanks :)


0

Response Number 3
Name: Dick Walther
Date: October 23, 2009 at 11:07:08 Pacific
Reply:

I need a script to start a search engine submission site. Also do you know a script to start a web site traffic site?

[URL=http://www.internet-marketing-website-design.com/]san diego internet marketing company[/URL]


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Search Engine Script

Need personal webpage search engine www.computing.net/answers/webdevel/need-personal-webpage-search-engine/577.html

search engine architecture and desi www.computing.net/answers/webdevel/search-engine-architecture-and-desi/2717.html

multiple search engine options www.computing.net/answers/webdevel/multiple-search-engine-options/3533.html