Jump to content

Methods for conting downloads


Recommended Posts


try this cgi script, caveman.

http://www.utilmind.com/scripts/downloadcounter.html. looks like you just need to alter your links a little to point to the script.

I like liquidplasmas idea for php.

call the script with a ?get parameter of the url of file from your table link.

then you could do a redirect something like this

<?php
// Redirect to the link URL
$url="files/mydll.dll";
Header("Location: $url")
?>

you can add some code to either increment a download count to a file or db. I wouldn't mind having this for my site as well, so I will try to help if you want to try it this way

Edited by dman
Link to comment
Share on other sites

carefull who you are calling caveman, i`ll hunt you down and eat you for dinner. :D:lol:

that cgi script looks ok but liquidplasmaflow PHP script idea is interesting, even though i don`t understand PHP. I`m going to go through this tutorial tomorrow.

BTW is your site the one in your sig?

Link to comment
Share on other sites

Nice find, lpf. This is similar to what I was proposing, passing the download url to a php script as a get parameter.

"Neanderthal" (sorry, didn't realize cavemen, er, hominids were so touchy.) Go club some chick over the head and drag her back to your cave by her hair, that always makes you feel better! :thumbup

If you are referring to the link in MY sig, then no. I wish I was talented enough to write dabo. This project is created in Python by former Foxpro guru Ed Leafe. I learned a lot about Foxpro from him, but because MS is trying to kill it the foxpro community is moving on. I think I am doing well when I can figure out how to USE Ed's code.

this is My Site. Dont laugh, it is work in progress and I am no graphics artist. :whistle: The freeware page and submission form are PHP/MySQL scripts. I am most proud of getting fixed menu frame to work in IE using CSS. Curse IE and its crappy CSS implementation, I only hope they can do better with IE7.

I am out of town till thursday. Read the tutes and if you still need help at end of week feel free to post or PM.

Edited by dman
Link to comment
Share on other sites

http://www.hotscripts.com/Detailed/33867.html <-- Try that. And to whose sig are you referring?

You are the master script finder, thank you i will give it a go, dman refered to his site earlyer i was wondering if that was it in his sig.

"Neanderthal" (sorry, didn't realize cavemen, er, hominids were so touchy.) Go club some chick over the head and drag her back to your cave by her hair, that always makes you feel better! thumbup.gif

LOL

your site looks ok, though in the second paragraph "your" should be "you" :P

Thanks for your help :thumbup

Edited by Neanderthal
Link to comment
Share on other sites

Wow, havent been in MSFN in a while. But I DID have a tutorial on this. I willl try and find it again and post it here.

EDIT:

I couldnt find my tutorial on it so i just did some research.

http://www.phpfreaks.com/quickcode/download_counter/230.php

http://www.phpjunkyard.com/php-click-counter.php

Edited by matrix0978
Link to comment
Share on other sites

matrix0978, have you thought of writing that tutorial out again, it would be realy usefull for me, and others i think.

I`m trying http://www.hotscripts.com/Detailed/33867.html but can`t get it to work properly.

I can link to a file in the specified download folder but it won`t work if i link to a file that is in a folder inside the specified download folder.

Also i can`t figure out how to view the download statistics.

Any help appreciated. it`s got me :wacko:

Link to comment
Share on other sites

my download folder is called "dll" so i have set the variable in download.php like this,

$FILES_DIR = "/dll/";

and my links are therefore,

href='download.php?file=A3D.RAR'

but if i try to link to a file inside a sub folder inside my download folder. eg,#

/dll/A/A3D.RAR

the link

href='download.php?file=/dll/A/A3D.RAR'

or

href='download.php?file=/A/A3D.RAR'

won`t work.

Is there any way to make this work or can i only link to files in the root of my specified download folder?

Link to comment
Share on other sites

Hi B.C. :lol:

Instead of hard-coding the $FILES_DIR variable, pass it as another get parameter, like this..

href='download.php?file=A3D.RAR&filedir=A'

in the download script, set it like this...

$FILES_DIR = $_GET['filedir'];

Link to comment
Share on other sites

sorry, you need to still add the backslashes and the rest of your path to the string. Somrething like

$FILES_DIR = "/dll/" . $_GET['filedir'] . "/";

Edited by dman
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...