I'm working with PHP and I use friendly URL.
When you click the <a class="nav-link" href="<?php echo URL::getBase(); ?>blog" tabindex="12">blog</a>
link, my URL is:
Opening the page blog.php
it contains the function getBlog()
function that lists all articles, with a pagination of 10 per page.
By clicking on one of these articles, my URL is:
Opening the page artigo.php
this contains the function:
function getViewBlog() {
// Ler URL (array)
$url = $_SERVER['REQUEST_URI'];
$valor = explode("/", $url);
// Recebe o id do rgf_content via GET
$id_blog = $valor[3];
...
}
Where to get the id_blog
of the URL and show the full content of this article on this page.
What I'm trying to accomplish is to make these two functions open on the same page as here in this case would be blog.php
.
HOME > ROGARFIL.COM.BR > ARTICLE > 63 > TI > MY COMPANY NEEDS A WEBSITE
The reason that leads me to this logic is that the way it is and when I am on the page artigo.php
and clicking on the breadcrumbs link in article the error appears:
Notice: Undefined offset: 3 in C: \ xampp \ htdocs \ rogarfil.com.br \ src \ includes \ files \ functions.php on line 326
Because the URL of the $id_blog
variable does not appear in the URL.