Qbasicnews.com

Full Version: Site design: Counting the number of downloads?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How I could count the number of downloads for each source I put in my site?
Learn Perl and JavaScript. With those two scripts working together, you can make any kind of counter.
Perl is the most-used CGI script, and JavaScript...You know what JavaScript is :wink:
javascript can't be used, but perl or php (or asp, or any cgi script for that matter). but it's hard to say if lycos supports cgi (and i doubt it).
Thanks all:
I see i must learn PHP! Lycos supports it (Nathan has a forum at Qbsux, I imagine it's php)
I just installed a local server and run my first hello.php...
Seems interesting :bounce:
Warning: wizardlife and I will flood this forum with questions!
My idea was

Code:
<a href="download.zip><?php add-to-counter script ?></a>

But I don't know. I'm new at php as well.
Quote:javascript can't be used...
I meant Javascript AND Perl. Together.
Perl could be used alone. But if you know JavaScipt, why not? Smile
Quote:a href="download.zip><?php add-to-counter script ?></a>

I use

Code:
<a href="get.php?thefilenamewitoutdotzip></a>

http://dascdev.net
I use that coundet, assuming that is the link, im just guessing..
edit: it works!
i would use the following, though I think this code could be wrong:

http://www.mysite.com/download.php?filen...lename.zip

Code:
<?php
$handle = fopen($filename, "r");
while (!feof ($handle)) {
    $buffer = fgets($handle, 4096);
}
fclose ($handle);

$buffer++;

$handle = fopen($filename, "a");
fwrite ($handle, $buffer);
fclose ($handle);

header("Location: http://yoursite.com/downloads/$filename");
?>
Quote:Thanks all:
I see i must learn PHP! Lycos supports it (Nathan has a forum at Qbsux, I imagine it's php)
I just installed a local server and run my first hello.php...
Seems interesting :bounce:
Warning: wizardlife and I will flood this forum with questions!

And I, will flood this forum with Frontpage questions. LOL
Quote:How I could count the number of downloads for each source I put in my site?

PHP 8)

www.phpfreaks.com >>> tutorials, scripts [paid and some free] and more!

If you can't find what you need than I will write you a php script and add it to our database 8)