ok i am browsing from a different machine not the webserver. my index.php has this:
$sitename is defined in my includes file. This way if I want to call the file from somewhere it points to the right place. I believe it is this thats causing the problems.
include("$sitename/counter.php");
if i just make it
include("counter.php");
it works fine. So how can I specify my sitename without effecting the includes?
ps my counter script is as follows:
<?php
require_once("incs/sqlconnect.php");
$referer = $_SERVER['HTTP_REFERER'];
$remote_address = $_SERVER['REMOTE_ADDR'];
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$query_count = "SELECT * from ws_counter_stats";
$result_count = @mysql_query ($query_count);
while ($row_count = mysql_fetch_array($result_count, MYSQL_NUM)){
$hits = $row_count[1];
$count = $count+$hits;
}
$query = "SELECT * from ws_counter";
$result = @mysql_query ($query);
while ($row = mysql_fetch_array($result, MYSQL_NUM)){
//$count = $row[0];
$increase = $row[1];
$textbefore = $row[2];
$textafter = $row[3];
$show = $row[4];
$maths = $count+$increase;
If($show == "Yes") {
print ("$textbefore $maths $textafter");
}
}
$query_add = "INSERT INTO `ws_counter_stats` (`hits`, `remote_address`, `user_agent` , `referer`) VALUES ('$increase', '$remote_address', '$user_agent', '$referer');";
$result_add = @mysql_query ($query_add);
mysql_close();
?>
P.S. i am not really the best with PHP just started really but this is all my own... so dun laugh 😛