0
I am working with PHP and use friendly URL.
By clicking on the link <a class="nav-link" href="<?php echo URL::getBase(); ?>blog" tabindex="12">blog</a>
, my URL gets:
Opening the page blog.php
this contains the function function getBlog()
listing all articles with a 10 page page page page.
By clicking on one of these articles, my URL is:
http://127.0.0.1/rogarfil.com.br/artigo/63/ti/minha-empresa-precisa-de-website
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 does the id_blog
of the URL and shows all the contents of this article on this page.
What I am seeking to accomplish is to have these two functions open on the same page as here in this case would be the blog.php
.
HOME > ROGARFIL.COM.EN > ARTICLE > 63 > IT > MY COMPANY NEEDS WEBSITE
The reason I come to this logic is that the way it is and when I’m on the page artigo.php
and when clicking on the link of the article Readcrumbs appears the error:
Notice: Undefined offset: 3 in C: xampp htdocs rogarfil.com.br src includes files functions.php on line 326
Because the URL does not show the contents of the variable $id_blog
.
just use the isset on the conditional if
– Rogarfil