0

I have some problem when I tried to run my website on localhost. After I configure all of the config and I run the site I got this error.

Notice: Undefined index: ORIG_PATH_INFO 
Notice: Undefined index: PATH_INFO

I used this code in my function :

$path = str_replace(".php","",$_SERVER['ORIG_PATH_INFO']); 
if($path == ""){$path = str_replace(".php","",$_SERVER['PATH_INFO']); }

My questions is why I got that error and how to fixed this error ? Thanks in advance.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Antonio
  • 755
  • 4
  • 14
  • 35
  • Check here: https://stackoverflow.com/questions/4261133/php-notice-undefined-variable-notice-undefined-index-and-notice-undef – Marylyn Lajato Jun 03 '17 at 03:05
  • superglobal variable `$_SERVER` does not have to have everything setted up... check before use if its set or not like `if(isset($_SERVER['ORIG_PATH_INFO'])){ /* use */ }` – Kazz Jun 03 '17 at 04:14

0 Answers0