zero-perfoliate
zero-perfoliate

Author Topic: PHP scripts suddenly stopped working  (Read 396 times)

Offline oxygen

  • New PHP Members
  • Posts: 1
  • Karma: +0/-0
PHP scripts suddenly stopped working
« on: January 19, 2009, 05:06:29 AM »
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

Offline PhPHelper

  • http://Digiscapers.com
  • Full Member
  • PHP Problem Solvers
  • ****
  • Posts: 179
  • Karma: +50/-0
    • Bad Apple Mail
Re: PHP scripts suddenly stopped working
« Reply #1 on: February 10, 2009, 05:54:04 PM »
It will be in one of the include files if you can't find it post the contents and I'll take a look for you.