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
[SOLVED] hits counts
Moderator: General Moderators
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
Change the links to <a href="download.php?file=matrix.dat">Download</a>
download.php
Something like that.
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>";Thanks so much my friend . Soved my prob Thanks so muchkettle_drum wrote:Change the links to <a href="download.php?file=matrix.dat">Download</a>
download.phpSomething like that.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>";