*

Anonymous

  • ****
  • 200 posts
Undefined index: REQUEST_URI in index.php
« on: December 24, 2017, 08:52:52 AM »
/* ------------------------------ Advanced premium sorting -------------------------------------*/
//modify search to be able to sort ads first by premium (is / not) and then by date

function bo_mgr_sort_by_premium() {
  Search::newInstance()->order('b_premium DESC, dt_pub_date DESC', '');
}

$enchance_search = osc_get_preference('bo_mgr_enchance_premium_search', 'anchor-bo_mgr') <> '' ? osc_get_preference('bo_mgr_enchance_premium_search', 'anchor-bo_mgr') : 1;
 
Code: [Select]
if($enchance_search == 1 && strlen(strstr ($_SERVER['REQUEST_URI'],'sOrder')) == 0) {   osc_add_hook('search_conditions', 'bo_mgr_sort_by_premium');
}
/* ----------------------------------------------------------------------------------------------*/

Code: [Select]
$_SERVER['REQUEST_URI'],


above is the chunk of code - index.php

getting error-  Undefined index: REQUEST_URI


please, correct me if am wrong-

i have implement $url
Code: [Select]
$url =$_SERVER['REQUEST_URI']
now am not getting error in debug.log

is it the right way. pls, correct me....if am wrong :)

« Last Edit: December 24, 2017, 08:55:02 AM by Anonymous »
Innovation is change that unlocks new value  ;)

*

MB Themes

Re: Undefined index: REQUEST_URI in index.php
« Reply #1 on: December 30, 2017, 10:45:39 AM »
@anonymous
Use @$_SERVER['REQUEST_URI'] instead.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Anonymous

  • ****
  • 200 posts
Re: Undefined index: REQUEST_URI in index.php
« Reply #2 on: January 13, 2018, 05:11:56 AM »
Hi,
Quote
Use @$_SERVER['REQUEST_URI'] instead.

You mean to say,
I should use  (@)

@$_SERVER['REQUEST_URI']


M i right.
Innovation is change that unlocks new value  ;)

*

MB Themes

Re: Undefined index: REQUEST_URI in index.php
« Reply #3 on: January 13, 2018, 10:14:53 AM »
Yes it disable notices.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots