phprouter / main

Secure router with XSS and CSRF
MIT License
514 stars 143 forks source link

Can't get the variable from the url, and only routes if the .php file is in the root directory #30

Closed aszitymartin closed 2 years ago

aszitymartin commented 2 years ago

I have the same folder structure as this guy in this video: (https://www.youtube.com/watch?v=T9To0blu9qs), but it's not working me like in the video. If I write localhost/test/items in the url it won't work. But if I change the get('/items', 'views/items.php') to get('/items', 'items.php') it will work.

My other problem is, when I have the get('/product/$type/', 'product.php'), in the product.php I cannot get the $type variable, because it does not exist. Any idea why this is happening?

phprouter commented 2 years ago

Variables from the URL/Query String should be retrieved by using the super global $_GET