Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Number of downloads  (Read 3127 times)

0 Members and 1 Guest are viewing this topic.

myownworldoffuture

  • Guest
Number of downloads
« on: February 13, 2007, 06:18:24 PM »
How do you put the number of downloads..?
Like in some sites it says
Downloads(100) previews(100)
something like that and how do you make a file download to another computer?

fffreak



    Adviser

  • That's right I am a final fantasy freak.
  • Thanked: 3
    • Yes
    • JSPCRepair
  • Certifications: List
  • Experience: Guru
  • OS: Windows 7
Re: Number of downloads
« Reply #1 on: February 13, 2007, 06:23:39 PM »
You would have to put a click counter script in your website. By script, I mean PHP, Perl, Python, ASP, or some other alternative, it has to be some kind of server side scripting... Also, do you mean download to another computer with out their knowledge :o, or make the normal download box popup? If you are trying to acheive "the normal download box popup", all you have to do is provide a link to the file that you are allowing to be downloaded, There are also numerous other ways in which to do so, I will list them below. Who is your webhost? As to the click counter, depending on what they offer, you may not be able to make a click counter. Get back with us on who your webhost is and what they offer and maybe I or someone else can come up with something for a click counter.

You could just provide a simple link...
Code: [Select]
<a href="http://yourdomain.com/file.ext">file.ext</a>
Or

You can use the meta refresh tag...
Code: [Select]
<meta http-equiv="refresh" content="#numofseconds;url=http://yourdomain.com/file.ext">
You can also use javascript redirects...
Quote
<script type="text/javascript">
<!--
window.location = "http://yourdomain.com/file.ext"
//-->
</script>

This is how you can acheive a redirect using php...
Code: [Select]
<?php
header
'Location: http://yourdomain.com/file.ext' ) ;
?>
Note: This must go before the html

This is how you can acheive a redirect using perl...
Code: [Select]
#!/usr/bin/perl -w
use strict;
use CGI qw/:standard/;
print redirect('http://yourdomain.com/file.ext');

This is how you can acheive a redirect using ASP...
Code: [Select]
<%
Response.Redirect "http://yourdomain.com/file.ext"
%>

Somebody correct me if I am wrong but I think this is how you do a redirect with Python...
Code: [Select]
return context.REQUEST.RESPONSE.redirect('http://yourdomain.com/file.ext)

And the last one that I will show you is for a redirect using JSP...
Code: [Select]
response.sendRedirect("http://yourdomain.com/file.ext");
Hope this helps,
 8-)fffreak
« Last Edit: February 13, 2007, 07:49:28 PM by fffreak »
Computers are the future, not us. Learn everything you can about them while you still can, soon they will be learning about us... Every bit of advice that I give you is best guess, it is your choice whether or not you listen to it.