Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

   

Reply
 
LinkBack Thread Tools Display Modes
Old 02-16-2005, 01:22 PM   #1 (permalink)
DOS
Senior Member
 
DOS's Avatar
 
Join Date: 08-03-04
Posts: 1,077
iTrader: 0 / 0%
Latest Blog:
None

DOS is a splendid one to beholdDOS is a splendid one to beholdDOS is a splendid one to beholdDOS is a splendid one to beholdDOS is a splendid one to beholdDOS is a splendid one to beholdDOS is a splendid one to beholdDOS is a splendid one to beholdDOS is a splendid one to beholdDOS is a splendid one to beholdDOS is a splendid one to behold
Simple Download Counter

Does anyone know where I could find a simple counter that counts the number of times a link is clicked and displays it?
DOS is offline  
Add Post to del.icio.us
Reply With Quote
Old 02-17-2005, 06:47 AM   #2 (permalink)
Possible Terrorist
 
kwvarga's Avatar
 
Join Date: 10-13-03
Location: Tuscaloosa, AL or Atlanta
Posts: 4,904
iTrader: 0 / 0%
Latest Blog:
A+ Certification

kwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web prokwvarga is a highly respected web pro
Send a message via AIM to kwvarga
link to
download.php?file=url/to/file;

download.php
Code:
<?php $file = $_GET['file']; //connect to mysql $q = "SELECT * FROM downloads"; $r = mysql_query($q) or die(mysql_error()); if (mysql_num_rows($r) < 1) { $q = "INSERT INTO downloads (url, times) VALUES('$file', '1')"; } else { $q = "UPDATE downloads (url, times) VALUES('$file', times + 1) where url = '$file'"; } $r = mysql_query($q) or die(mysql_error()); ?>
view.php
Code:
<?php //mysql connect stuff $file = "file.exe"; $q = "SELECT * FROM downloads WHERE url = '$file'"; $r = mysql_query($q); $row = mysql_fetch_array($r); echo "File has been downloaded $row[1] times"; ?>
try that
__________________
Kyle Varga
"m3lt/theSpear"
student, web designer/coder, future IT consultant
Experience: PHP/MySQL, Java, C++, MS-SQL
kwvarga is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Which web counter do I believe?!?! ewomack Marketing Forum 16 08-12-2007 08:12 AM
Spam Counter ewomack Digital Photography 4 02-23-2007 05:58 PM
Tutorials: Simple Hit Counter t4vn.net Coding Forum 4 01-24-2007 11:42 AM
Invisible Hit Counter - can anyone help us on this one??? chrisnrach17 Coding Forum 4 01-26-2004 07:25 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 02:56 AM.
© Copyright 2008 V7 Inc