Re: questions about using include() in php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2008-07-19 at 11:57 +0530, Sudhakar wrote:
> i am doing seo for a website and this website uses a lot of php for which i
> need suggestions. this is how the website is set up.
> 
> in the index.php file there is a flash banner at the top of the page and the
> center part is another file which is called using include("links.php") and
> the bottom part using include("footer.php")
> the footer has links such as = webdevelopment software development ... each
> of this has a query string= http://website.com/index.php?page=webdevelopmentand
> http://website.com/index.php?page=software ... etc
> 
> this way every link in the website is calling index.php and a query string
> is being passed and the index.php looks for the name ex=webdevelopment and
> loads that particular page in the center section of the website. the main
> purpose of doing this was to load the flash file only 1 time and the rest of
> the time when the links from the footer are clicked only the center part
> changes and the flash file does not have to reload.
> 
> due to this the entire website is having only 1 page index.php therefore
> using 1 <title> tag 1 meta description and 1 meta keywords tag as the values
> of <title> and <meta> tags are being displayed from index.php
> 
> however from a seo and sem perspective ideally there should be different
> file name which means i can optimize the <title> and <meta> tags for
> individual files.
> 
> please advice a best solution to get around this as i would like to have
> different title and meta tag for individual pages like webdevelopment.php
> software.php etc which i am presently not able to due to include("")
> 
> any help will be greatly appreciated.

File: index.php
===============
<?php

ob_start();
include( 'webdevelopment.php' );
$GLOBALS['pageMainContent'] = ob_get_contents();
ob_end_clean();

include( 'header.php' );
include( 'layout.php' );
include( 'footer.php' );

?>

File: webdevelopment.php
========================
<?php

$GLOBALS['pageTitle'] = 'Web Development';

echo 'blah blah blah blah blah blah';

?>

File: header.php
================
<html>
<head>
    <title><?php echo
htmlspecialchars( $GLOBALS['pageTitle'] ) ?></title>
</head>
<body>


File: footer.php
================
</body>
</html>


File: layout.php
================
<div class="leftPane">
    Menu...
</div>
<div class="mainContent">
    <?php echo $GLOBALS['pageMainContent'] ?>
</div>
<div class="rightPane">
    Ads ;)
</div>


Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux