Page 1 of 1
hits counts
Posted: Thu Jul 15, 2004 10:41 am
by phpcoder
hi guys,
I have a some prob . i have a page on my LAN that displays link of different movies when user click on any of link the movie starts downloading wat i want is to count the # of hits of movie i have my sql data base dat will update on hits plz help me how i will update my hits count table when user click on the movie links . I knw the form tag but i dont need submit button i want to update table on link click
plz help
Posted: Thu Jul 15, 2004 10:43 am
by kettle_drum
Have the links point to a page where you count the clicks and then redirect to the download.
page with link -> link counter page -> download file
Posted: Thu Jul 15, 2004 10:45 am
by phpcoder
kettle_drum wrote:Have the links point to a page where you count the clicks and then redirect to the download.
page with link -> link counter page -> download file
can u give show me code if u can the link i have is
<a href ="smcserver/movies/matrix.dat">download</a>
Posted: Thu Jul 15, 2004 10:54 am
by kettle_drum
Change the links to <a href="download.php?file=matrix.dat">Download</a>
download.php
Code: Select all
//connect to database
mysql_query("UPDATE downloads SET hits = hits+1 WHERE file = '".$_GET['file']."'"):
header("Redirect: blah/blah/movies/".$_GET['file']);
echo "If your download does not start then please click <a href="blah/blah/movies/".$_GET['file']."">here</a>";
Something like that.
Posted: Thu Jul 15, 2004 10:57 am
by phpcoder
kettle_drum wrote:Change the links to <a href="download.php?file=matrix.dat">Download</a>
download.php
Code: Select all
//connect to database
mysql_query("UPDATE downloads SET hits = hits+1 WHERE file = '".$_GET['file']."'"):
header("Redirect: blah/blah/movies/".$_GET['file']);
echo "If your download does not start then please click <a href="blah/blah/movies/".$_GET['file']."">here</a>";
Something like that.
Thanks so much my friend . Soved my prob Thanks so much