Hi I have 2 functions in an included file. The function does exsist but the page says NOT.
function isCrap() // line 10 in included file
<?
/**********************************************
* functions.inc 25-08-2007 Desmond O'Toole. *
* Include file for general functions MAIN *
* 3.1.0 *
**********************************************/
session_start();
include ("config.php");
function isCrap()
{
// Do nothing This function does exsist.
}
function connectDB($db)
{
switch ($db)
{
case 1:
$host = hostname;
$user = username;
$pass = password;
$data = database;
break;
}
$link = mysql_connect($host, $user, $pass) or die("Houston we have problem");
$database = @mysql_select_db ($data, $link);
}
function isRobot($Browser)
{
$Robot = 0;
if(strpos($Browser, W3C) !== false)
$Robot = "1";
if(strpos($Browser, MICROSOFT) !== false)
$Robot = "1";
if(strpos($Browser, YAHOO) !== false)
$Robot = "1";
if(strpos($Browser, ASK) !== false)
$Robot = "1";
if(strpos($Browser, GOOGLE) !== false)
$Robot = "1";
return $Robot;
}
function isRobot_x($Browser)
{
$Robot = 0;
if(strpos($Browser, MAJESTIC) !== false)
$Robot = "1";
if(strpos($Browser, SNAPBOT) !== false)
$Robot = "1";
if(strpos($Browser, VOYAGER) !== false)
$Robot = "1";
if(strpos($Browser, CFETCH) !== false)
$Robot = "1";
if(strpos($Browser, HOUXOU) !== false)
$Robot = "1";
if(strpos($Browser, TWICELER) !== false)
$Robot = "1";
if(strpos($Browser, MSNBOT) !== false)
$Robot = "1";
if(strpos($Browser, GOOGLEMAPS) !== false)
$Robot = "1";
if(strpos($Browser, YANGA) !== false)
$Robot = "1";
if(strpos($Browser, ALEXA) !== false)
$Robot = "1";
if(strpos($Browser, PUREBOT) !== false)
$Robot = "1";
return $Robot;
}
function StoreData($Page)
{
connectDB(1);
$IP = $_SERVER['REMOTE_ADDR'];
$hit = 'N';
if ($_SESSION['current_page'] == "")
$hit = 'Y';
if ($_SESSION["K9"] == "1")
$hit = 'R';
if ($_SESSION["Atack"] == "1") // Apears not to be used Des 13/03/2009
$hit = 'A';
$_SESSION["K208"] = ipband2("208.80.193.000","208.80.195.255",$IP); // 208.80.195.29 ?
$Stranger = ipband2("91.121.64.0","91.121.127.255",$IP); // Unusual visitor. reported on website groups
if ($Stranger == 1)
{
$hit = 'A';
$_SESSION['K9'] = 1;
}
if ($_SESSION["K208"] == 1)
{
$hit = '?';
$_SESSION['K9'] = 1;
}
$sql = "SELECT * FROM `config`";
$query = mysql_query($sql) or die("Houston we have problem");
$rs = mysql_fetch_array($query);
$do = $rs['dbLog'];
if($_SESSION['Event_Log'] == 'YES')
{
$browser = $_SERVER["HTTP_USER_AGENT"];
$stamp = time();
$Date = date('Y-m-d',$stamp);
$Time = date('H:i:s',$stamp);
$IP = $_SERVER['REMOTE_ADDR'];
$DateTime = date("Y-m-d H:i:s", $row['Stamp']);
//$sql = "INSERT INTO `EventLog` VALUES ('','" . $stamp . "','" . $Date . "','" . $Time . "','" .$IP . "','" . $Page . "','" . $browser . "','" . $hit . "')";
$sql = "INSERT INTO `EventLog` VALUES ('','" . $stamp . "','" . $DateTime . "','" .$IP . "','" . $Page . "','" . $browser . "','" . $hit . "')";
$query = mysql_query ($sql);
$result = @mysql_affected_rows($sql);
}
}
function StoreData_login($Pwd1,$Pwd2)
{
connectDB(1);
$browser = $_SERVER["HTTP_USER_AGENT"];
$stamp = time();
$Date = date('Y-m-d',$stamp);
$Time = date('H:i:s',$stamp);
$IP = $_SERVER['REMOTE_ADDR'];
$sql = "INSERT INTO `FailedLog` VALUES ('','" . $Date . "','" . $Time . "','" . $IP . "','" . $Pwd1 . "','" . $Pwd2 . "','" . $browser . "')";
$query = mysql_query ($sql);
$result = @mysql_affected_rows($sql);
}
function get_hit_counter()
{
/*
$sql = "SELECT * FROM `config`";
$query = mysql_query($sql) or die("Houston we have problem");
$rs = mysql_fetch_array($query);
$cnt = $rs['Count'];
return $cnt;
*/
$sql = "SELECT count(*) As Total FROM `EventLog` WHERE Hit = 'Y'";
$query = mysql_query($sql) or die("Bad Count");
$rs = mysql_fetch_array($query);
$cnt = $rs['Total'] + 20;
return $cnt;
}
function hitcounter()
{
connectDB(1);
$sql = "SELECT * FROM `config`";
$query = mysql_query($sql) or die("Houston we have problem");
$rs = mysql_fetch_array($query);
$do = $rs['HitCounter'];
$cnt = $rs['Count'];
if($_SESSION['Event_Log'] <> 'NO' && $do == 'Y')
{
$cnt++;
$sql = "UPDATE `config` SET Count = '" . $cnt . "'";
$query = mysql_query ($sql);
Report();
}
}
?>
isCrap(); // line 8 on page
<?
include ("functions.php");
$accept = $_SERVER["HTTP_ACCEPT"];
$Browser = $_SERVER['HTTP_USER_AGENT'];
$RemoteAddress = $_SERVER['REMOTE_ADDR']; //172.55.44.33
$domain = $_SERVER['HTTP_HOST']; //des-otoole.co.uk ?
isCrap();
if (!isset($_GET['counter']))
$_GET['counter'] = "";
if (!isset($_GET['Event_Log']))
$_GET['Event_Log'] = "";
if (!isset($_SESSION['current_page']))
$_SESSION['current_page'] = '';
if (!isset($_SESSION['K9']))
$_SESSION['K9'] = '';
$_SESSION['Event_Log'] = "YES";
if($_GET["counter"] != "")
$_SESSION['Event_Log'] = "NO";
if(isIE7($Browser) == 1) // $Browser = "MSIE 7.0-WebDAV-MiniRedir/5.1.2600";
{
mailto("MSIE 7");
//header('Location: 666.php');
exit;
}
connectDB(1);
$sql = "SELECT * FROM `config`";
$query = mysql_query($sql) or die(mysql_error());
$rs = mysql_fetch_array($query);
$Construction = $rs['Construction'];
$Robot = $rs['Robot'];
$IP = $rs['IP'];
$dbLog = $rs['dbLog'];
$page = "Home";
$IsMe = IsMe($RemoteAddress , $IP);
if($Construction == 'Y' && $IsMe == 'N')
{
include('UnderConstruction.php');
exit;
}
$_SESSION['K9_X'] = "0";
//if(isRobot_x($Browser) == 1)
// exit;
$_SESSION['K9'] = "0";
$_SESSION['K9'] = isRobot($Browser);
if($Robot == 'Y') // Default to robot
$_SESSION['K9'] = 1;
if(ipband2("91.121.64.0","91.121.127.255",$RemoteAddress) == 1) // Unusual visitor. reported on website groups
$_SESSION['K9'] = 1;
if($_SESSION['Event_Log'] == 'YES' && $_SESSION['current_page'] == "" && $_SESSION['K9'] == 0)
hitcounter();
$Total_Hits = get_hit_counter();
if($_SESSION['current_page'] <> 'index.php')
{
StoreData($page); // Only if Event_Log = 'YES' and Flag 'dbLog' = 'Y'
if($_SESSION['K9'] == 0 || $dbLog == 'N')
mailto($page);
}
$_SESSION['current_page'] = 'index.php';
if($_SESSION['K9'] == 0 && $Robot == 'N')
{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<META HTTP-EQUIV="imagetoolbar" CONTENT="no">
<LINK rel="stylesheet" href="style.css" type="text/css">
<TITLE>Home</TITLE>
</HEAD>
<BODY>
<div id="side-menu">
<!--
<a onmouseover="document.images[0].src='images/Family-H.gif'"
onmouseout="document.images[0].src='images/Family.gif'"
href="Family.php" rel="nofollow"><IMG src="images/Family.gif" alt=""></a>
<br>
-->
<a onmouseover="document.images[0].src='images/Testimony-H.gif'"
onmouseout="document.images[0].src='images/Testimony.gif'"
href="Testimony.php"><IMG src="images/Testimony.gif" alt=""></a>
<br><br>
<a onmouseover="document.images[1].src='images/Contact-H.gif'"
onmouseout="document.images[1].src='images/Contact.gif'"
href="Contact.php" rel="nofollow"><IMG src="images/Contact.gif" alt=""></a>
</div>
<div id="me">
<div>
<div id="001">
<img src="MalawiPics/MalawiMe.jpg" alt=""><br>
<span style="color:green">Malawi 2009</span>
</div>
</div>
<br>
<span class="Info">
Visitors since April 2006 <?=display_hits($Total_Hits)?>
excluding web robots</span>
</div>
<div id="w3c">
<br><br><br><br>
<IMG src="images/w3c.gif" alt=""> <IMG src="images/css.gif" alt="">
<br><br><br>
</div>
</BODY>
</HTML>
<?}
else
{
//echo("File error");
include('robot.html');
}?>
ANY help apreciated.