I have some PHP and HTML in the same file, and I am not exactly sure how to make the URL appear as the name of that page.
Here is an example of what I would like to do: lets say some page id = 1 and the title of that page is HelloWorld.
Instead of site.com/page.php?id=1
I would like the url to appear as site.com/HelloWorld
But the problem I am having is that I only get to know the title of the page inside that page after I query for the title by id.
Considering the setup I described, is there a way to make the urls appear as the names of the pages? And also, if someone links to that page by using the better looking url with the name of the page instead of the id, is there still a way to get the id and by that, the rest of the page contents?
Thanks!!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…