Forum Moderators: coopster
Does anyone know how to assign unique titles to html pages that are dynamically created through php?
The problem I’m having is that although the pages on my site have html extensions when loaded in the browser they are not present on my server, this must mean that they are generated dynamically.. right? For this reason I am unable to assign unique titles to each page.
I’m new to php so this is extremely confusing, can anyone please shed some light.
Many thanks in advance.
Lee
No, this isn't my site and I'm not a programmer unfortunaltely.. I just know HTML.
There are no headers or footers on the pages, in fact the only pages that exist on the server are php pages with no html in them... i'm just not sure where the .html pages are genereted... it's all blowing my mind!
Thanks again, Lee
well try not to hurt yourself ;)
ok, so we have some unknown software or script that is generating the pages. Any clue as to what software it might be? If not you can still find where the titles are.
Try seeing if there are any scripts called Template or something.
also, how do you add content to the site?
If you see lines something like:
RewriteRule ^(.*?)page.html$ showpage.php?page=$1
Then the system is using the script you see on the right of the RewriteRule (in this case, showpage.php).
If you don't see these lines, look for:
ErrorDocument 404 somescript.php
The the system is using a '404-trick' to serve the pages. Read the file named as the script on the right of the line (in this case, somescript.php).
In both cases, my best guess is that all pages are held in a database, and headers and footers are held in separate files (look for a templates directory or files named header.php or footer.php).
The database may not have a TITLE field in it - if not - add one. You then need to modify the script you found to load the files, and output them.
usually you would have a database field which would be used to create the page title OR it would be created using a standard phrase plus some keywords from the database.
when the data is entered there should be a way of entering a title for the page.
perhaps not ... in which case there are ways to do it from the other data in the data base
There are many template files all with .tpl extensions.
Heres the code for catolgue.php page; If you navigate from the website you access the catologue.html page but this page does not exist on the server.
<?php
include('./inc/config.php');
/* Breadcrumb Display */
$breadcrumb_names = array('Home','Catalogue');
$breadcrumb_urls = array('index.html','catalogue.html');
$smarty->assign('breadcrumb_names',$breadcrumb_names);
$smarty->assign('breadcrumb_urls',$breadcrumb_urls);
/* Meta Tags */
list($keywords,$description,$title) = MetaKeywords::GetMetaKeywords('catalogue_choice');
$smarty->assign('keywords',$keywords);
$smarty->assign('description',$description);
$smarty->assign('title',$title);
$fastMoverChart = new FastMoverChart();
$smarty->assign('fastmover',$fastMoverChart);
$coolCutsCharts = CoolCutsCharts::FindAll();
$smarty->assign('coolcuts',$coolCutsCharts);
$letters = array('0','A','B','C','D','E','F','G',
'H','I','J','K','L','M','N',
'O','P','Q','R','S','T','U',
'V','W','X','Y','Z'
);
$smarty->assign('letters',$letters);
//Last updated date for catalogues
$db =& Registry::GetDBConnection();
$newUpdated = SqlUtilities::GetTableLastUpdated(&$db,'products');
$secondHandUpdated = SqlUtilities::GetTableLastUpdated(&$db,'secondh');
$smarty->assign('newUpdated',$newUpdated);
$smarty->assign('secondHandUpdated',$secondHandUpdated);
$smarty->display('catalogue_Index.tpl');
?>
Any ideas?
There is a rewrite rule so guess you've solved the problem of the elusive .html files! There is also a header.php file.
So what I need to do is;
> Add TITLE field to database
> Amend the header.php file to output these new fields to the pages
Guess now all I need is someone to do it for me.. for a price of course!
Cheers to all you guys, at least now I know what I need to do