Well, I'll try to make it happen!
I have a site in php where you have the config.php file with the following lines
<?php
$current_page_uri = $_SERVER['REQUEST_URI'];
$part_url = explode("/", $current_page_uri);
$page_name = end($part_url);
$email_id = "[email protected]";
?>
On the index.php page the following setting
<?php
include "app/config.php";
include "app/detect.php";
if ($page_name=='') {
include $browser_t.'/index.php';
}
elseif ($page_name=='index.php') {
include $browser_t.'/index.php';
}
elseif ($page_name=='sobre.php') {
include $browser_t.'/sobre.php';
}
elseif ($page_name=='galeria.php') {
include $browser_t.'/galeria.php';
}
elseif ($page_name=='servicos.php') {
include $browser_t.'/servicos.php';
}
elseif ($page_name=='contato.php') {
include $browser_t.'/contato.php';
}
elseif ($page_name=='contato-post.php') {
include $browser_t.'/contato.php';
include 'app/contato.php';
}
else
{
include $browser_t.'/404.html';
}
?>
When I enter normal pages as about.php
, galeria.php
, the browser opens normally.
I already have a problem with http://localhost/meusite/galeria.php
, there are all the photos of the products coming from Mysql, and there is a pagination to advance the products on the pages.
When I select to advance a page of products in which the link takes the reference of the page that is, example http://localhost/meusite/galeria.php?pagina=2
the site does not open.
If I insert into index.php the line below it works.
elseif ($page_name=='galeria.php?pagina=2') {
include $browser_t.'/galeria.php';
}
I have a problem also in the search button of the site that can search the product, when I search for example product code: "6554"
When I click on search it would have to open the page http://localhost/meusite/galeria_busca.php?id=6554&busca=
It just does not open either, but as a test I inserted the following line in index.php and it worked.
elseif ($page_name=='galeria_busca.php?id=6554&busca=') {
include $browser_t.'/galeria_busca.php';
}
I would like the help of someone to tell me what I am doing wrong that is not opening normally without having to put the search paths in index.php because I have many products and it would be impracticable to create a line of code for each product code .
Any questions are available.