I'm getting the following error when I use $_SERVER['PATH_INFO']
on my localhost:
Notice: Undefined index: PATH_INFO
I'm using WAMP. Can someone tell me why this is happening?
PATH_INFO isn't always set. It is only set if there was trailing path info after the script.
For example if you have a file located here: localhost/index.php And you access it via this url: localhost/index.php/foo/bar
then $_SERVER['PATH_INFO'] will be set to a value of "/foo/bar"
but if you access the script via the url: localhost/index.php then PATH_INFO will not be set and you will see a notice like that for attempting to access an undefined index of an array
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With