Advertisement
Guest User

Untitled

a guest
May 31st, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.56 KB | None | 0 0
  1. <?php
  2.     if (isset($_GET['s']) && !mb_detect_encoding($_GET['s'], 'UTF-8', true)) {
  3.         $_GET['s'] = utf8_encode($_GET['s']);
  4.         $params = 's=' . $_GET['s'];
  5.  
  6.         // parâmetros do ac
  7.         if (isset($_GET['p'])) {
  8.             $params .= '&p=' . $_GET['p'];
  9.         }
  10.         if (isset($_GET['ranking'])) {
  11.             $params .= '&ranking=' . $_GET['ranking'];
  12.         }
  13.         if (isset($_GET['typeclick'])) {
  14.             $params .= '&typeclick=' . $_GET['typeclick'];
  15.         }
  16.         if (isset($_GET['ac_pos'])) {
  17.             $params .= '&ac_pos=' . $_GET['ac_pos'];
  18.         }
  19.  
  20.         header("HTTP/1.1 301 Moved Permanently");
  21.         header('Location: /busca?' . $params);
  22.         exit();
  23.     }
  24.     if (isset($_GET['pesquisa'])) {
  25.         header("HTTP/1.1 301 Moved Permanently");
  26.         header('Location: /busca?s=' . $_GET['pesquisa']);
  27.         exit();
  28.     }
  29.  
  30.     /**
  31.      * Includes the site general functions
  32.      */
  33.     include_once dirname(__FILE__) . DIRECTORY_SEPARATOR . 'define.php';
  34.    
  35.     try
  36.     {
  37.         // Instantiate the neemu object
  38.         $neemu = new Neemu($storeConfig);
  39.  
  40.         // runs the search
  41.         $neemu->localSearch($searchConfig);
  42.        
  43.         // ajaxSearch  
  44.         if (isset($_GET['ajaxSearch']) && $_GET['ajaxSearch'] == 1 ) {
  45.            echo $neemu->getAjaxJson();
  46.            exit;
  47.         }else {
  48.            redirectPDP($neemu);
  49.         }
  50.     }
  51.     catch (Exception $e)
  52.     {
  53.         include 'header.php';
  54.         include 'not-found.php';
  55.         include 'footer.php';
  56.         exit;
  57.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement