-2

I just start learning PHP and to learn faster I start to make a simple CMS. I know somethings about PHP, but the problem I'm facing right now is this.

I learn how to get values from URL like:

post.php?id=54

I see a lot of websites with nice URLs

http://www.example.org/category/title-name-post

When I make a post I want to create nice pages and URLs like that.And one more thing how can I link the post to a category in MySQL .

  • Search Google and/or this site for "php how to make pretty urls" After trying some of the solutions out there, please return here with any questions! –  Sep 15 '16 at 03:37
  • Possible duplicate of [Reference: mod\_rewrite, URL rewriting and "pretty links" explained](http://stackoverflow.com/questions/20563772/reference-mod-rewrite-url-rewriting-and-pretty-links-explained) – chris85 Sep 15 '16 at 03:39
  • 1
    If you tried something add what you tried to the question. The link/dup I provided gives details on how to create/use `pretty URLs`. This site is for coding issues, you haven't presented any code yet. – chris85 Sep 15 '16 at 04:02
  • Funny how first thing the people notice is to make bad :) – Adrian Prime Sep 15 '16 at 05:32
  • you look for duplicate instead to help me lol – Adrian Prime Sep 15 '16 at 05:33

1 Answers1

0

Typically this is down through frameworks that use a url router concept. I looked into making my own once and found it a bit challenging. If you want to stick with PHP and jump into a framework I personally like Laravel the best. laracasts.com is a great resource to get up and running.

If you do wish to get a tutorial on working with a custom router check out this video. https://www.youtube.com/watch?v=6reEBParHzQ

PhxSteve
  • 103
  • 1
  • 13