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
  • 704,970
  • 168
  • 1,303
  • 1,425
Antonio
  • 749
  • 4
  • 14
  • 33
  • Check here: https://stackoverflow.com/questions/4261133/php-notice-undefined-variable-notice-undefined-index-and-notice-undef – User 328 6227 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