windows media flaw or is my code flawed???
I finally got the click counter to work correctly. but something in the code that lets you preview the movies doesn't quite work correctly.
go to this link, and look at the counter and refresh...
you see it adds one, that is correct and works fine, but go to the next link...
and you will notice that it adds 3. in fact the first link is the only one that adds 1. this problem is only with the videos because they have a preview. the download link will add 1 correctly and all too, its just the media player that causes it to act funky. i've tried setting the autostart to false but no luck. i also have reason to believe there could be a problem with my query. if anybody has any ideas it would be greatly appreciated!
here is my code...
<?php
#vars
$id = $HTTP_GET_VARS[id];
$name = $HTTP_GET_VARS[name];
$type = $HTTP_GET_VARS[type];
$size = $HTTP_GET_VARS[size];
$path = $HTTP_GET_VARS[path];
$artist = $HTTP_GET_VARS[artist];
$filename = $HTTP_GET_VARS[filename];
$filetype = $HTTP_GET_VARS[filetype];
$bootname = $HTTP_GET_VARS[bootname];
$description = $HTTP_GET_VARS[description];
$click_count = $HTTP_GET_VARS[click_count];
$date = $HTTP_GET_VARS[date];
#cagegory
$sql = \"SELECT * FROM `downloads` WHERE `filetype`='video' AND `artist`='$artist' AND `bootname`='$bootname' AND `filename`='$filename' AND `click_count`>='0' ORDER BY 'filename'\";
$result = mysql_query( $sql );
if (!$result) {
echo(\"<P>Error performing query: \" .
mysql_error() . \"</P>\");
exit();
}
while ($row = mysql_fetch_array($result)) {
echo(\"<p class=\\"page_font_header\\"><a href=\\"http://www.sublimestylee.com/pages/videos_artist.php\\">Videos</a> > <a href=\\"http://www.sublimestylee.com/pages/videos_cat.php?artist=$artist\\">$artist</a> > <a href=\\"http://www.sublimestylee.com/pages/videos_list.php?artist=$artist&bootname=$bootname\\">$bootname</a> > $filename</p>\");
echo(\"<p class=\\"page_font\\">\");
echo(\"<br><div id=\\"video\\"><embed src=\\"http://www.download.sublimestylee.com/download.php?id=$id\\" width=\\"320\\" height=\\"283\\" autostart=\\"1\\" showcontrols=\\"1\\" type=\\"application/x-mplayer2\\" pluginspage=\\"http://www.microsoft.com/windows/windowsmedia/download/\\"> </embed><br>\");
echo(\"Click the below link to download video<br>\");
echo(\"<a href=\\"http://www.download.sublimestylee.com/download.php?id=$id\\">$artist - $filename</a> <a href='javascript:popUp(\\"http://www.download.sublimestylee.com/more_info.php?id=$id\\")'><img src=\\"http://www.sublimestylee.com/page_images/info.gif\\" border=\\"0\\"></a><br><br>\");
echo(\"Downloaded <b>\" . $row[\"click_count\"] . \"</b> times since <b>\" . $row[\"date\"] . \"</b><br><br>\");
echo(\"<a href='javascript:popUp(\\"http://www.sublimestylee.com/pages/code.php?id=$id\\")'>Add this video to your webpage</a></div>\");
echo(\"</p>\");
}
?>
thanks!
-drew