window.open('crawler.php?pg=$page_num'); "; } if (isset($_POST['remove-url'])) { $url = $_POST['url']; $file_contents = file_get_contents('txt/url_to_crawl.txt'); $str = str_replace($file_contents, '', $file_contents); file_put_contents('txt/url_to_crawl.txt',$str); } if (isset($_POST['add-url'])) { $url = $_POST['url']; $file = "txt/url_to_crawl.txt"; $bundler = fopen($file, "ab"); if (filter_var($url, FILTER_VALIDATE_URL)) { fwrite($bundler, "$url \n"); } fclose($bundler); } function access_secure($str) { $access = "password"; if ($access === $str) { return true; } else { return false; } } if (isset($_POST['access-code'])) { $text = $_POST['access-code']; if (access_secure($str)) { echo 'access granted. proceeding to empty index....'; $sql = "TRUNCATE TABLE `colleges`"; $db = get_database(); $db->query($sql); file_put_contents('url.txt', ''); } else { echo 'wrong access code.'; } echo ''; } if (isset($_POST['remove-db-row'])) { $str = trim($_POST['url-to-remove']); $row = trim($_POST['row-to-remove']); $sql = "DELETE FROM colleges WHERE $row = :str"; $db = get_database(); $stmt = $db->prepare($sql); $stmt->bindParam(':str', $str, PDO::PARAM_STR, 12); $stmt->execute(); } if (isset($_POST['insert-to-db'])) { $name = $_POST['insert-name']; $link = $_POST['insert-url']; $description = $_POST['insert-description']; $sql = "INSERT INTO colleges (name, description, link) VALUES (:name, :description, :link)"; $db = get_database(); $stmt = $db->prepare($sql); $stmt->bindParam(':name', $name, PDO::PARAM_STR, 12); $stmt->bindParam(':description', $description, PDO::PARAM_STR, 12); $stmt->bindParam(':link', $link, PDO::PARAM_STR, 12); $stmt->execute(); } if (isset($_POST['clear-log'])) { file_put_contents('txt/searches.txt', ''); } if (isset($_POST['access-code-query'])) { $sql = trim($_POST['query']); $access_code = $_POST['access-code-query']; if (access_secure($access_code)) { $db = get_database(); $query = $db->query("$sql"); print_r($query->fetchAll()); } } if (isset($_POST['log-out'])) { session_destroy(); $_SESSION = array(); echo ''; } ?> Control Panel
Crawler Settings

The current urls in the crawler. These urls are waiting to be indexed, or have already been indexed.




PureSearch Index
query('SELECT COUNT(*) FROM colleges')->fetchColumn(); echo "

Number of rows in database: $nRows

"; ?>
query($sql) as $row) { echo ''; echo ''; echo ''; echo ''; echo ''; } ?>
Name Description Link
' . @escapeHTML($row['name']) . '' . @escapeHTML($row['description']) . '' . @escapeHTML($row['link']) . '

Database Actions

Perform a query on the database

Remove row from database










Add a row to the database

Recent Searches