I am sure this is easy but I can't figure it out...
Here is the form.
<?php
$searchString = $_POST["search"];
if (!isset($_POST['submit']))
?>
<html>
<head>
<title>Personal INFO</title>
</head>
<body>
<form method="post" action="search.php">
<input type="text" size="20" maxlength="20" name="search">
<br />
<input type="submit" value="submit" name="submit">
</form>
</body>
</html>
Here is the script I am trying make work.
$searcher = new
FileSystemStringSearch('/logs/','$searchString');
$searcher->run();
if($searcher->getResultCount() > 0) {
echo('<p>Searched "'.$searcher->getSearchPath().'" for string
<strong>"'.$searcher->getSearchString().'":</strong></p>');
echo('<p>Search term found <strong>'.$searcher->getResultCount().'
times.</strong></p>');
echo('<ul>');
foreach($searcher->getResults() as $result) {
echo('<li><em>'.$result['filePath'].', line
'.$result['lineNumber'].'</em>:<br />
'.$searcher->highlightSearchTerm($result['lineContents']).'</li>');
}
echo('</ul>');
} else {
echo('<p>Searched "'.$searcher->getSearchPath().'" for string
<strong>"'.$searcher->getSearchString().'":</strong></p>');
echo('<p>No results returned</p>');
}
?>
This is the result...
Searched "/logs/" for string "$searchString":
No results returned
Thanks in advance for the help.