Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
- header("Cache-Control: post-check=0, pre-check=0", false);
- header("Pragma: no-cache");
- setlocale(LC_TIME, 'de_DE', 'deu_deu');
- date_default_timezone_set("Europe/Berlin");
- set_time_limit(300);
- # session start
- session_start();
- # includes
- include("error.php");
- include("config.php");
- include("class/database.php");
- include("class/run.php");
- # connect and create
- $GLOBALS['db'] = database::connect(HOST,USER,PASSWORD,DATABASE);
- if(isset($_GET['sq'])) {
- $foundArray = array();
- $sq = $GLOBALS['db']->escape_string($_GET['sq']);
- echo "Ihr Suchbegriff: <strong>".$sq."</strong>";
- echo "<hr/>";
- $query0 = "SELECT * FROM pages WHERE title LIKE '%".$sq."%'";
- $data0 = run::query($query0);
- $query = "SELECT * FROM tt_content WHERE header LIKE '%".$sq."%' OR bodytext LIKE '%".$sq."'";
- $data = run::query($query);
- if($data0) {
- foreach($data0 AS $d) {
- $pid = $d->uid;
- $foundArray[$pid] = $pid;
- }
- }
- if($data) {
- foreach($data AS $d) {
- $pid = $d->pid;
- $foundArray[$pid] = $pid;
- }
- }
- if(count($foundArray)>0) {
- foreach($foundArray AS $fA) {
- $get = "SELECT uid,title FROM pages WHERE uid='".$fA."'";
- $finalData = run::query($get)[0];
- ?>
- <div class="ajaxSearchContainer">
- <div class="ajaxSearchContainerHeadline"><a href="index.php?id=<?php echo $finalData->uid; ?>"><?php echo utf8_encode($finalData->title); ?></a></div>
- </div>
- <?php
- }
- } else {
- ?>
- Ihre Suche ergab leider keine Treffer
- <?php
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement