I'm developing a dynamic website and dynamic url pages, my problem is as follows:
When I put in the link the id to view the details of the property <a href="/imovel?id<echo $row['id_imovel']>">
, the property.php file does not receive the id that was sent via get.
In the url, when it receives property includes imovel.php, but when it is immovable? id = 3174 for example is not made the inclusion.
HTACCESS
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?pagina=$1
PHP:
function getHome(){
$url = $_GET['pagina'];
$url = explode('/', $url);
$url[0] = ($url[0] == NULL ? 'content' : $url[0]);
if(file_exists('tpl/'.$url[0].'.php')){
require_once('tpl/'.$url[0].'.php');
}elseif(file_exists('/tpl/'.$url[0].'/'.$url[1].'.php')){
require_once('tpl/'.$url[0].'/'.$url[1].'.php');
}elseif(file_exists('/tpl/'.$url[0].'/'.$url[1].'/'.$url[2].'.php')){
require_once('tpl/'.$url[0].'/'.$url[1].'/'.$url[2].'.php');
}else{
require_once('tpl/404.php');
}
How to solve?