How do you create a blog post page using url variables in PHP?

I’ve been researching this for a while but I can’t get my head around it.
Here’s the thing:
I have a mySQL database with a ‘posts’ table and ‘ID’, ‘title’, ‘content’ and ‘author’ and I have all of the post’s thumbnails displayed on my page.
However none of them have working link. I’ve seen people doing things like href=”mypage/post?id=1″, but how does one

First: not get a 404 not found page

Second: make a query to the database to display the information correctly

Third: make a link between a path that is not in your directory and the database

Forth: Structured the information properly

Fifth: somehow use the $_SERVER variables? idk

Any information/documentation would be extremely helpful! Thanks in advance

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.