{"id":180,"date":"2013-05-10T07:58:42","date_gmt":"2013-05-10T07:58:42","guid":{"rendered":"http:\/\/test.bleuanus.nl\/index.php\/rtl-xl\/search-engine\/"},"modified":"2018-12-11T16:09:10","modified_gmt":"2018-12-11T15:09:10","slug":"search-engine","status":"publish","type":"post","link":"https:\/\/www.bleuanus.nl\/index.php\/2013\/05\/10\/search-engine\/","title":{"rendered":"Search engine"},"content":{"rendered":"<p class=\"last-modified\">This post was most recently updated on December 11th, 2018<\/p><p>&nbsp;A simple search engine has been created to search on specific keywords:<\/p>\n<pre title=\"code\" class=\"brush: php;\"><!--?php\/\/ $argument = $_GET[\"series\"];include 'Mobile_Detect.php';$detect = new Mobile_Detect();\/\/ Include config filerequire_once(dirname(__FILE__).'\/config.php');echo '<html-->'; echo '<title>RTL Gemist: Zoeken<\/title>\t\t<meta http-equiv=\"Content-Type\" content=\"text\/html; charset=iso-8859-1\">\t\t<meta name=\"viewport\" content=\"width=320; user-scalable=no; maximum-scale=1;\">\t\t<meta name=\"MobileOptimized\" content=\"320\">\t\t<meta name=\"HandheldFriendly\" content=\"true\">\t\t \t<link rel=\"stylesheet\" href=\"style.css\" type=\"text\/css\">\t\t \t<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image\/x-icon\">\t\t\t\t<script type=\"text\/javascript\"><!--\t\t\t\tvar menuOpened = 0;\t\tfunction openMenu()\t\t{\t\t\tif(menuOpened)\t\t\t{\t\t\t\tmenuOpened = 0;\t\t\t\tdocument.getElementById(\"day_menu\").style.display = \"none\";\t\t\t\tdocument.getElementById(\"day_button\").style.background = \"none\";\t\t\t\tdocument.getElementById(\"day_button\").style.color = \"#fff\";\t\t\t}else\t\t\t{\t\t\t\tmenuOpened = 1;\t\t\t\tdocument.getElementById(\"day_menu\").style.display = \"block\";\t\t\t\tdocument.getElementById(\"day_button\").style.background = \"#fff\";\t\t\t\tdocument.getElementById(\"day_button\").style.color = \"#000\";\t\t\t}\t\t}\t\t-->\t\t<\/script>';echo '';echo '\n<h2><a href=\"http:\/\/rtl.bleuanus.nl\"><img loading=\"lazy\" decoding=\"async\" src=\"witte-home-icon.png\" width=\"25\" height=\"25\"><\/a><a><font color=\"WHITE\"><center>RTL Gemist: Zoeken<\/center><font><\/font><\/font><\/a><\/h2>\n<a><font color=\"WHITE\"><font>\n';?&gt;<center><script type=\"text\/javascript\"><!--google_ad_client = \"ca-pub-8947666366861525\";\/* RTL Zoeken *\/google_ad_slot = \"4526959854\";google_ad_width = 320;google_ad_height = 50;\/\/--><\/script><script type=\"text\/javascript\" src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\"><\/script><\/center><!--?phpecho '<br \/-->';echo '<\/font><\/font><\/a><font color=\"WHITE\"><font><a id=\"day_button\" href=\"zoeken.php\">Zoeken<\/a>';echo '<a id=\"day_button\" href=\"rtlgemist.php?day=1\">Maandag<\/a>';echo '<a id=\"day_button\" href=\"rtlgemist.php?day=2\">Dinsdag<\/a>';echo '<a id=\"day_button\" href=\"rtlgemist.php?day=3\">Woensdag<\/a>';echo '<a id=\"day_button\" href=\"rtlgemist.php?day=4\">Donderdag<\/a>';echo '<a id=\"day_button\" href=\"rtlgemist.php?day=5\">Vrijdag<\/a>';echo '<a id=\"day_button\" href=\"rtlgemist.php?day=6\">Zaterdag<\/a>';echo '<a id=\"day_button\" href=\"rtlgemist.php?day=7\">Zondag<\/a>';echo '<a id=\"day_button\" href=\"http:\/\/rtl.bleuanus.nl\/programs.php\">Alle Programmas<\/a>\n\n';echo '';echo '';echo '';echo '    ';echo '\n<table width=\"100%\">\n<tbody>\n<tr>\n<td>Geef de gewenste zoekterm op:';echo '    <form action=\"search.php\" method=\"GET\">';echo '\t<input type=\"text\" name=\"query\">';echo '\t<input type=\"submit\" value=\"Search\"><\/form><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n';?&gt;<center><script type=\"text\/javascript\"><!--google_ad_client = \"ca-pub-8947666366861525\";\/* RTL Zoeken *\/google_ad_slot = \"4526959854\";google_ad_width = 320;google_ad_height = 50;\/\/--><\/script><script type=\"text\/javascript\" src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\"><\/script><!--?phpinclude 'footer.php';?--><!-- Piwik --> <script type=\"text\/javascript\">var pkBaseURL = ((\"https:\" == document.location.protocol) ? \"http:\/\/192.168.178.50\/piwik\/\" : \"http:\/\/192.168.178.50\/piwik\/\");document.write(unescape(\"%3Cscript src='\" + pkBaseURL + \"piwik.js' type='text\/javascript'%3E%3C\/script%3E\"));<\/script><script type=\"text\/javascript\">try {var piwikTracker = Piwik.getTracker(pkBaseURL + \"piwik.php\", 3);piwikTracker.trackPageView();piwikTracker.enableLinkTracking();} catch( err ) {}<\/script><noscript>\n<img decoding=\"async\" src=\"http:\/\/192.168.178.50\/piwik\/piwik.php?idsite=3\" style=\"border:0\" alt=\"\">\n<\/noscript><!-- End Piwik Tracking Code --><!--?phpecho \"<\/body\";echo \"<\/html-->\";?&gt;<\/center><\/font><\/font><\/pre>\n<p><font color=\"WHITE\"><font><\/p>\n<p>After pushing the search button it will show results using this page:<\/p>\n<pre title=\"code\" class=\"brush: php;\"><!--?php\/\/ Include config filerequire_once(dirname(__FILE__).'\/config.php');mysql_connect(localhost,$username,$password);@mysql_select_db($database) or die( \"Unable to select database\");\t?-->\t\t\t<!--?phpecho '<html-->'; echo '<title>RTL Gemist: Zoeken<\/title>\t\t<meta http-equiv=\"Content-Type\" content=\"text\/html; charset=iso-8859-1\">\t\t<meta name=\"viewport\" content=\"width=320; user-scalable=no; maximum-scale=1;\">\t\t<meta name=\"MobileOptimized\" content=\"320\">\t\t<meta name=\"HandheldFriendly\" content=\"true\">\t\t \t<link rel=\"stylesheet\" href=\"style.css\" type=\"text\/css\">\t\t \t<link rel=\"shortcut icon\" href=\"favicon.ico\" type=\"image\/x-icon\">\t\t\t\t<script type=\"text\/javascript\"><!--\t\t\t\tvar menuOpened = 0;\t\tfunction openMenu()\t\t{\t\t\tif(menuOpened)\t\t\t{\t\t\t\tmenuOpened = 0;\t\t\t\tdocument.getElementById(\"day_menu\").style.display = \"none\";\t\t\t\tdocument.getElementById(\"day_button\").style.background = \"none\";\t\t\t\tdocument.getElementById(\"day_button\").style.color = \"#fff\";\t\t\t}else\t\t\t{\t\t\t\tmenuOpened = 1;\t\t\t\tdocument.getElementById(\"day_menu\").style.display = \"block\";\t\t\t\tdocument.getElementById(\"day_button\").style.background = \"#fff\";\t\t\t\tdocument.getElementById(\"day_button\").style.color = \"#000\";\t\t\t}\t\t}\t\t-->\t\t<\/script>';echo '';echo '\n<h2><a href=\"http:\/\/rtl.bleuanus.nl\"><img loading=\"lazy\" decoding=\"async\" src=\"witte-home-icon.png\" width=\"25\" height=\"25\"><\/a><a><font color=\"WHITE\"><center>RTL Gemist zoeken<\/center><font><\/font><\/font><\/a><\/h2>\n<a><font color=\"WHITE\"><font>\n';?&gt;<center><script type=\"text\/javascript\"><!--google_ad_client = \"ca-pub-8947666366861525\";\/* RTL Zoeken *\/google_ad_slot = \"4526959854\";google_ad_width = 320;google_ad_height = 50;\/\/--><\/script><script type=\"text\/javascript\" src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\"><\/script>\t\t<script>  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)  })(window,document,'script','\/\/www.google-analytics.com\/analytics.js','ga');  ga('create', 'UA-39975359-1', 'bleuanus.nl');  ga('send', 'pageview');<\/script><\/center><!--?phpecho '<br \/-->';echo '<\/font><\/font><\/a><font color=\"WHITE\"><font><a id=\"day_button\" href=\"rtlgemist.php?day=1\">Maandag<\/a>';echo '<a id=\"day_button\" href=\"rtlgemist.php?day=2\">Dinsdag<\/a>';echo '<a id=\"day_button\" href=\"rtlgemist.php?day=3\">Woensdag<\/a>';echo '<a id=\"day_button\" href=\"rtlgemist.php?day=4\">Donderdag<\/a>';echo '<a id=\"day_button\" href=\"rtlgemist.php?day=5\">Vrijdag<\/a>';echo '<a id=\"day_button\" href=\"rtlgemist.php?day=6\">Zaterdag<\/a>';echo '<a id=\"day_button\" href=\"rtlgemist.php?day=7\">Zondag<\/a>';echo '<a id=\"day_button\" href=\"http:\/\/rtl.bleuanus.nl\/programs.php\">Alle Programmas<\/a>\n\n';\/\/ echo '';?&gt;= $min_length){\t\t\/\/ if query length is more or equal minimum length then\t\t$query = htmlspecialchars($query);\t\t\/\/ changes characters used in html to their equivalents, for example: &lt; to &gt;\t\t$query = mysql_real_escape_string($query);\t\t\/\/ makes sure nobody uses SQL injection\t\t$raw_results = mysql_query(\"SELECT * FROM item\t\t\tWHERE (`serieskey` LIKE '%\".$query.\"%') OR (`samenvattinglang` LIKE '%\".$query.\"%')\") or die(mysql_error());\t\techo '\n<h2>\n<div id=\"content\">U heeft gezocht op: '.$query.'<\/div><\/h2>\n\n';\t\t\/\/\techo '\n<table width=\"100%\"><!--?php    $query = $_GET['query'];\t\/\/ gets value sent over search form\t\t$min_length = 3;    \/\/ you can set minimum length of the query if you want\t\tif(strlen($query) --><\/table>\n';\t\t\/\/ * means that it selects all fields, you can also write: `id`, `title`, `text`\t\t\/\/ articles is the name of our table\t\t\/\/ '%$query%' is what we're looking for, % means anything, for example if $query is Hello\t\t\/\/ it will match \"hello\", \"Hello man\", \"gogohello\", if you want exact match use `title`='$query'\t\t\/\/ or if you want to match just full word so \"gogohello\" is out use '% $query %' ...OR ... '$query %' ... OR ... '% $query'\t\tif(mysql_num_rows($raw_results) &gt; 0){ \/\/ if one or more rows are returned do following\t\t\twhile($results = mysql_fetch_array($raw_results)){\t\t\t\/\/ $results = mysql_fetch_array($raw_results) puts data from database into array, while it's valid it does the loop\t\t\t$title=$results['title'];\t\t\t$serienaam=$results['serienaam'];\t\t\t$episodetitel=$results['episodetitel'];\t\t\t$dayname=$results['dayname'];\t\t\t$thumbnail=$results['thumbnail'];\t\t\t$movie=$results['movie'];\t\t\t$broadcastho\nur=$results['broadcasthour'];\t\t\t$samenvattingkort=$results['samenvattingkort'];\t\t\t\techo \"\n\n\n<h3><center>\".$serienaam.\"<\/center><\/h3>\n\nAflevering: \".$title.\"\n\n<hr>\n\n\";\t\t\t\techo '\n<table width=\"100%\"><\/table>\n';\t\t\t\techo \"\";\t\t\t\techo \"\";\t\t\t\techo '\"; \t\t\t\t\/\/ posts results gotten from database(title and text) you can also show id ($results['id'])\t\t\techo \"\n<table width=\"100%\">\n<tbody>\n<tr>\n<td style=\"width:150;vertical-align:top;\"><a href=\".$movie.\"><img loading=\"lazy\" decoding=\"async\" src=\".$thumbnail.\" width=\"150\" height=\"92\"><\/a><\/td>\n<td><a href=\" '.$movie.' \"><span class=\"extra_info\">Datum: '.$dayname.' '.$broadcasthour.' \n';\t\t\t\techo \"Omschrijving: \".$samenvattingkort.\" <\/span><\/a>\n\";\t\t\t\techo \"<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n\n\";\t\t\t}\t\t}\t\telse{ \t\/\/ if there is no matching rows do following\t\t\techo \"No results\";\t\t}\t}\telse{\t\/\/ if query length is less than minimum\t\techo \"Minimum length is \".$min_length;\t}?&gt;<script type=\"text\/javascript\"><!--google_ad_client = \"ca-pub-8947666366861525\";\/* RTL Zoeken *\/google_ad_slot = \"4526959854\";google_ad_width = 320;google_ad_height = 50;\/\/--><\/script><script type=\"text\/javascript\" src=\"http:\/\/pagead2.googlesyndication.com\/pagead\/show_ads.js\"><\/script><!--?phpinclude 'footer.php';?--><\/font><\/font><\/pre>\n<p><font color=\"WHITE\"><font><\/p>\n<p><\/font><\/font><\/font><\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post was most recently updated on December 11th, 2018&nbsp;A simple search engine has been created to search on specific keywords: &#8216;; echo &#8216;RTL Gemist: Zoeken &#8216;;echo &#8221;;echo &#8216; RTL Gemist: Zoeken &#8216;;?&gt;&#8217;;echo &#8216;Zoeken&#8217;;echo &#8216;Maandag&#8217;;echo &#8216;Dinsdag&#8217;;echo &#8216;Woensdag&#8217;;echo &#8216;Donderdag&#8217;;echo &#8216;Vrijdag&#8217;;echo &#8216;Zaterdag&#8217;;echo &#8216;Zondag&#8217;;echo &#8216;Alle Programmas &#8216;;echo &#8221;;echo &#8221;;echo &#8221;;echo &#8216; &#8216;;echo &#8216; Geef de gewenste zoekterm op:&#8217;;echo [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-180","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.bleuanus.nl\/index.php\/wp-json\/wp\/v2\/posts\/180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bleuanus.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bleuanus.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bleuanus.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bleuanus.nl\/index.php\/wp-json\/wp\/v2\/comments?post=180"}],"version-history":[{"count":1,"href":"https:\/\/www.bleuanus.nl\/index.php\/wp-json\/wp\/v2\/posts\/180\/revisions"}],"predecessor-version":[{"id":213,"href":"https:\/\/www.bleuanus.nl\/index.php\/wp-json\/wp\/v2\/posts\/180\/revisions\/213"}],"wp:attachment":[{"href":"https:\/\/www.bleuanus.nl\/index.php\/wp-json\/wp\/v2\/media?parent=180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bleuanus.nl\/index.php\/wp-json\/wp\/v2\/categories?post=180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bleuanus.nl\/index.php\/wp-json\/wp\/v2\/tags?post=180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}