-1

I don't know how can I get data from an url without having any sort of variable. For example if the user comes to the website welcome.com and he starts adding to the url
EX: welcome.com/NewYork-NY/Driver

how can I save NewYork-NY and Driver when he/she hits enter ? I need to save the data in order to list some content for the user and the only option for him to get to this content is if he goes to that URL manually, there is no button or option for him to chose between cities or categories.

Manos Nikolaidis
  • 21,608
  • 12
  • 74
  • 82

1 Answers1

1

The superglobal $_SERVER['PATH_INFO'] contains all the parts of the URL path after the script. So if the user goes to:

welcom.com/index.php/NewYork-NY/Driver

$_SERVER['PATH_INFO'] will contain /NewYork-NY/Driver.

Barmar
  • 741,623
  • 53
  • 500
  • 612