Hello all
We are presently having a short online contest. We have webtrends as our web traffic reporting tool.
For the online contest, it's .html page that sends all form data to a php file which sends entries to the database. I also have a counter mechanism written in PHP for the .html page to see how many people came to the .html page versus number of entries, and the difference is huge.
Below is my counter code:
for ($count = 1; $row = mysql_fetch_row ($result); ++$count)
{}
$now = getdate();
$id = $count++;
$referer = "$HTTP_REFERER";
for ($i=0; $i < strlen($id); $i++)
{
$sign = substr($id, $i, 1);
}
if ($referer != "http://www.mysite.com/samepagePostback.html")
{
if ($ebuddy == smtp)
{
$counter = "INSERT INTO counter (ID, browser, referer, time, ebuddy) VALUES ('$id','$browser','$referer','$time','$ebuddy')";
$result = mysql_query($counter);
}
else
{
$counter = "INSERT INTO counter (ID, browser, referer, time) VALUES ('$id','$browser','$referer','$time')";
$result = mysql_query($counter);
}
}
?>
Forget the if ebuddy, the other one is the one to look at. The if statement, if referer does not indicate postback, only then increment counter, is this a good method?
The problem is that we have about 23% of users seem to be entering the contest. Is this normal? Would anyone be able to provide a site with stats in terms of viewing online contests vs. entering them? How normal is this?
Also, even in webtrends the number of people visiting the .html page vs. number of requests to the .php file, which sends form data to the database, is also quite large, however not as large as the counter mechanism.
Should I rely more on webtrends or my counter function?
What is going on, is this normal or am I loosing entries somewhere? PHP/Apache/MySQL/Linux....
Thanks
MK