Hello all,
I'm a fairly new PHP user who has bee thrown in at the deep end with an issue that is effecting several of our websites that were coded by a previous member of staff.
The scripts or the websites have not been changed, they have simply stopped working! With my knowledge of PHP I can't fathom out exactly what is happening.
The problem I think is that links (which are hard coded as HTML) should be redirected to PHP pages of a shorter name. For example a link to "vigo-catalog-winemaking.html" should end up as "winemaking.html"
The main index file includes other files to make up the page, but the script that included them and handles (I think) the creation of the link.
Here is the code for the page:
<?php
$include_file=$page . ".php";
$filename = $_SERVER['DOCUMENT_ROOT']. "/" . $include_file;
if (!file_exists($filename)) {
$include_file="home.php";
}
$title=str_replace("-", " ", $page);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> - products and services for drinks producers - <?=$title?></title>
<?php
include ("html_head.php");
?>
</head>
<?php
include ("html_body.php");
include ($include_file);
include ("html_footer.php");
?>
</body>
</html>
I personally cannot see where the variable $page is getting any value from at all, thus rendering the script useless. I just don't have the knowledge to sort this out. Any help would be gratefully received.
Many Thanks
Paul