how to pass title of a news post to the URL

0

I'm working with the friendly URLs in php and I've seen on many websites that the urls pass the same title of the content and I would like to know as I do not have idea of how to achieve it the friendly URLs work like this

<a href="<?php echo URLSERVER?>noticias/<?php echo $row['id']?>/">noticias</a>

news-view.php

 //obtener segunda variable enviada atraves de la URL
     $id=explode("/",$_GET["view"]);
 //hacer consulta a la bd segun el id
       $query=$con->query("SELECT
                    id, post_title, post_photo, post_content, fecha, type
                   FROM news
                   WHERE id='$id[1]' ");

  ?>

the ouput of the url is the following

link

What I would like to achieve would be that after the last pleca / add the title of the post obtained from the query of the database.

Any ideas on how I could achieve it? thank you very much

    
asked by andy gibbs 24.11.2018 в 23:33
source

0 answers