Hot Beans Web Development
Here is our contact information:
Address: John Avenue est gate street.
Post code: GL3 2SN
Contact us via our email: Hotbeans25@Icloud.com
Contact us via our mobile: 07562909000





The search result will be displayed in here.

', $bodybegin); if ($bodybegin === false) return false; $bodybegin += 1; $bodyend = strpos($filecontent, ''); if ($bodyend === false) return false; $titlecontent = substr($filecontent, $bodybegin, $bodyend-$bodybegin); $titlecontent = htmlspecialchars_decode($titlecontent); return $titlecontent; } // returns string fragment found or false function searchHTMLFile($filename, $tosearch) { $filecontent = file_get_contents($filename); if ($filecontent === false) return false; $bodybegin = strpos($filecontent, '', $bodybegin); if ($bodybegin === false) return false; $bodybegin += 1; $bodyend = strpos($filecontent, ''); if ($bodyend === false) return false; $bodycontent = substr($filecontent, $bodybegin, $bodyend-$bodybegin); $contentstripped = $bodycontent; $contentstripped = stripTagsWithContent($contentstripped, ''); $contentstripped = strip_tags($contentstripped); $contentstripped = html_entity_decode($contentstripped); $posfound = stripos($contentstripped, $tosearch); if ($posfound === false) return false; $fragmentSizeToReturn = 200; $fragmentStartPos = max(0, $posfound - ($fragmentSizeToReturn / 2)); $ret = substr($contentstripped, $fragmentStartPos, $posfound - $fragmentStartPos) . '' . substr($contentstripped, $posfound, strlen($tosearch)) . '' . substr($contentstripped, $posfound + strlen($tosearch), $fragmentSizeToReturn - ($posfound - $fragmentStartPos)) . '...'; // in case we truncated some utf sequences with substr, fix this here: $ret = mb_convert_encoding($ret, 'UTF-8', 'UTF-8'); return $ret; } $resulttext = ''; class searchEntry { public $name; public $url; } $allPages = array(); $searchquery = ''; if (isset($_POST['query'])) { $searchquery = $_POST['query']; $resulttext = 'Results for: ' . htmlentities($searchquery) . '

'; // build database $x = new searchEntry(); $x->name = ''; $x->url = 'index.html'; array_push($allPages, $x); $x = new searchEntry(); $x->name = ''; $x->url = 'web_development'; array_push($allPages, $x); $x = new searchEntry(); $x->name = ''; $x->url = 'career'; array_push($allPages, $x); $x = new searchEntry(); $x->name = ''; $x->url = 'apply'; array_push($allPages, $x); $x = new searchEntry(); $x->name = ''; $x->url = 'courses'; array_push($allPages, $x); $x = new searchEntry(); $x->name = ''; $x->url = 'search'; array_push($allPages, $x); $x = new searchEntry(); $x->name = ''; $x->url = 'thank_you'; array_push($allPages, $x); // now search database $resultsFound = 0; foreach ($allPages as $pageEntry) { $found = false; $fragmentToShow = ''; if (!(stripos(html_entity_decode($pageEntry->name), $searchquery) === false)) { $found = true; $fragmentToShow = $pageEntry->name; } else { $fragmentToShow = searchHTMLFile($pageEntry->url, $searchquery); if ($fragmentToShow !== false) $found = true; } if ($found) { // add as found $uptodateTitle = getHTMLFileTitle($pageEntry->url); if ($uptodateTitle !== false) $pageEntry->name = $uptodateTitle; $ptitle = $pageEntry->name == '' ? $pageEntry->url : $pageEntry->name; $resulttext .= '' . $ptitle . '
' . $fragmentToShow . '

'; $resultsFound += 1; } } if ($resultsFound == 0) $resulttext = '0 results found.'; } // display result or nothing // jsonencode doesn't like invalid unicode characters, so fix them if they are there: $resulttext_prep = mb_convert_encoding($resulttext, 'UTF-8', 'UTF-8'); $lnbr = "\n"; $jsresult = json_encode($resulttext_prep, JSON_UNESCAPED_UNICODE); echo '' . $lnbr; ?>