Say I have a user database and don't want to use get to get the id (user.php?i=234) and want to use folders and index.php(s) instead (user/234)
I can do this by creating a new folder and index.php file in that folder when the user registers. I can put an include inside the index.php file (include '/users.php'
) and call a function that builds the page (buildUserPage(234);
)
Is this the best way to do this?
How can I get the user id based on the parent folder if 234 is the user id?
How can I check if the url of the page is index.php so I can redirect to "../"?