Forum Moderators: coopster
Can someone spot what the error of this code is?
It's being redirecting me to the google page instead of the page i normally expect.
Here is the code:
<?php include('../includes/connection.inc.php');
/*include('../includes/logout_script.inc.php'); */
// define working variables = should match the database.table.fields' names
$this_page = $_SERVER['PHP_SELF'];
$IP = $_SERVER['REMOTE_ADDR'];
$date_auto = time();
$darconn = dbconnect('Admin');
$query = "insert into tracker(page, IP, date_auto) values('$this_page', '$IP', '$date_auto')";
mysql_query($query);
// retrieve how many times a particular page has been viewed;
// first define a query to do that
$query = "select count(*)as count from tracker where page = '$this_page'";
$result = mysql_query($query);
$views = mysql_result($result, 0, 'count');
?>
<html>
<head>
<title>Tracker_page</title>
<link rel="stylesheet" type="text/css" href="../CSS/global.css">
</head>
<body>
<div id="navigation">
<?php include('../includes/menu_main.inc.php');?>
</div>
<?php include('../includes/home_format.php');?>
<?php
if(isset($views))
{
echo $views;
}
else
{
echo "The page cannot be shown";
}
?>
</body>
</html>
Cheers,
dbarasuk