Hello, everyone
I set up my database table and modified the php on my site to include database name, username, password etc.
I also altered the flashvars to callback to my php page.
On my php page (which I assume is where the analytics data is supposed to be) all I get is "result=failure"
Can anyone help me out?
Player code for v4.4.174 JW FLV Media Player (swfobject v2.2):
'plugins': 'http://www.domain.com/path/yourlytics-1','yourlytics.callback': 'http://www.domain.com/path/callback.php?player=test.html', // sends player as _GET, sends file & state as _POST
//'yourlytics.callback': 'http://www.domain.com/path/callback.php', // sends file & state
callback.php
<?php// for testing, call with: http://www.domain.com/path/callback.php?file=filename.flv&title=Video Title&id=7h836&state=start&duration=30&author=Author's Name&description=Descriptive Text goes Here&userid=123456789
// this is the filename for the log file
$filename = 'callback.log';
//////////////////////// End of user configurable variables ////////////////////////////
extract($_GET, EXTR_PREFIX_SAME, "get_");
extract($_POST, EXTR_PREFIX_SAME, "post_");
//...debug
/*
print "<pre>\n";
print " File: " . $file . "\n";
print " Title: " . $title . "\n";
print " ID: " . $id . "\n";
print " State: " . $state . "\n";
print " Duration: " . $duration . "\n";
print " Author: " . $author . "\n";
print "Description: " . $description . "\n";
print " user ID: " . $userid . "\n";
print " player: " . $player . "\n";
print "</pre>";
exit;
*/
//...debug
// check to see if $filename exists, if not, create it.
touch($filename) or die("Unable to create: " . $filename);
// log file format: [01/Apr/2007:00:01:40 -0700]
$datetime = "[" . date('d/M/Y:h:i:s O') . "]";
$somecontent = $_SERVER[REMOTE_ADDR] . " - - " . $datetime . " \"" . $player . " : " . $file . " : " . $state . "\" - \"-\" \"" . $_SERVER[HTTP_USER_AGENT] . "\"\r\n";
$handle = fopen($filename, 'a') or die("Could not open file: " . $filename . "\n");
// Write $somecontent to the open file.
fwrite($handle, $somecontent) or die("Could not write to file: " . $filename . "\n");
//...debug
/*
fwrite($handle, "_POST:\r\n");
foreach($_POST as $k=>$v)
{
fwrite($handle, $k . "=" . $v . "\r\n");
}
fwrite($handle, "_GET:\r\n");
foreach($_GET as $k=>$v)
{
fwrite($handle, $k . "=" . $v . "\r\n");
}
*/
//...debug
fclose($handle);
?>