Well I have this simple question. I dont want the code on “how to do this” or etc. I just want to see if my knowledge/logic is correct on this….
I am creating a search engine for a orginization. (It will be a priviate search engine with a log in to even search it) anyways this search engine is going to search a database of users, and two databases or more of files. Now my question boils down to this. When in the search bar they type in their “term” that they want to search or “keyword” what ever you want to call it; store that in a temp array and then search the three or more databases using the temp array that was created using their terms and then find any matches within the databases and return the results.
So my train of thought as you can sort of see in the code below is useing an exsisting database (Temp array ATM “[I]$files[I]eregi()[I]matches[I]matches[I]eregi()
[CODE]<?php
//temp array of fake search items for testing
$files = array (‘spiewnik’, ‘Choc biedy dwie’, ‘Do ojczyzny’, ‘El Bajo’,
‘krzyz’, ‘warta’, ‘sprawnosci’, ‘formy’, ‘chicago’, ‘dom harcerskie’);
//get info from form
$terms = addslashes($_POST[‘terms’]);
//explode search terms set to array terms
$terms_array = explode (‘ ‘, $terms);
//count number of terms in box from array for use in temp code to show
$array_count = count ($terms_array);
?>
<html>
<head>
<title>Warta Search Engine (BETA V1.0) – Results</title>
</head>
<body>
<h1>Results for search:</h1>
<p>Here are your search terms:
<br />
<?php echo($terms); ?></p>
<br />
<p>Search array:
<br />
<?php
//Loops through the array to show (temp to see if creating) terms stored in array for use)
for ($i = 0; $i <$array_count; $i++) {
echo $terms_array[$i]. ” “;}
?></p>
</body>
</html>