Forum Moderators: coopster
I am a newbie here, and I am not familiar with php programing. Now I want to build a dynamic pages with index.php and php navigation, a smart navigation for SEO like this.
hxxp://mydomain.com/index.php
hxxp://mydomain.com/vietnam_tour/index.php
hxxp://mydomain.com/vietnam_tour/trekking_tour/sapa_trekking.php
something like that...
In the pass I used this:
Quote:
Quote:
[?php
if(!isset($_GET['page'])){
include "ps_vietnam_tour_operator_travel_agency_welcome_page.php";
}
elseif(isset($_GET['page'])){
if(file_exists("".$_GET['page'].".php")){
include "".$_GET['page'].".php";
}else{
echo"<h3>Your site was not found or under contruction</h3>
<p>Hit <i>back button</i> on your Browser to go back.";
}
}else{
include "ps_firstpage.php";
}
?]
to call file *.php in directory.
But it's not good for indexing in search engine, not friendly at all.
Someone knows how to build a smart navigation as I want and show me how to link to page (call pages), please post here.
Thanks man
Looking for good news from you my firends online
I normally use php for my page creation only, then mod_rewrite for search engine friendly url's. This does two things for me:
1. It keeps things straight in my head. My php only does php. Apache does URL's.
2. If anything breaks I know where it is... page not found=mod_rewrite : page won't display=php.
I know you can do this through php, but if you would like to use mod_rewrite, you might check out the apache forum.
Just my thoughts FWIW.
Justin
[codes]
<?
// Root path
define( 'ROOT_PATH', "./" );
$choice = array(
'home' => 'home',
'jobs' => 'jobs',
'contact' => 'contact',
'news' => 'news',
'readnews' => 'readnews',
'projects' => 'projects',
'viewproject'=> 'viewproject',
'catview'=> 'catview',
'clients'=> 'clients',
'logout' => 'logout'
);
/***************************************************/
if (! isset($choice[ $_GET['act'] ]) )
{
$_GET['act'] = 'home';
}
require ROOT_PATH."sources/".$choice[ $_GET['act'] ].".php";
?>
[/codes]