Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Need A Java Script/ Help, How to display download count on site?
shahhitesh10
post Jul 22 2006, 09:24 PM
Post #1


Newbie [Level 1]
*

Group: Members
Posts: 15
Joined: 7-July 06
From: India
Member No.: 26,265



dry.gif I am offering some download stuffs to the visitors of my site..
I have seen on some sites that they host download files on a box with 2 columns, the left one showing the filename and the right column showing the number of times the file has been downloaded..

I want to know how to do these.. Is there any javascript available for this..

if yes then please provide the link for the script.
Go to the top of the page
 
+Quote Post
electron
post Jul 23 2006, 07:30 AM
Post #2


Premium Member
********

Group: Members
Posts: 162
Joined: 10-May 06
Member No.: 23,375



I dont think it is posible using Java Script.
You can do it with a server side Language like PHP(I know that).

You could either use a DB(DataBase) or a FS(FileSystem).

But not JS.
Go to the top of the page
 
+Quote Post
shahhitesh10
post Jul 23 2006, 07:49 AM
Post #3


Newbie [Level 1]
*

Group: Members
Posts: 15
Joined: 7-July 06
From: India
Member No.: 26,265



Thanks electron for the reply..

I am not a web designer and i dont know php.. unsure.gif

Could you please explain me in detail step by step how to do this..
I have a mysql database..

Thanking u in advance.
Go to the top of the page
 
+Quote Post
electron
post Jul 24 2006, 04:06 AM
Post #4


Premium Member
********

Group: Members
Posts: 162
Joined: 10-May 06
Member No.: 23,375



Here is the script in PHP that uses the File System to count each vist.

CODE
<?php
}
$TextFile = "counter.txt";
$Count = trim(file_get_contents($TextFile));
$FP = fopen($TextFile, "r");
$Count=fgets($FP, 4096);fclose ($FP);
settype($Count, "integer");
$Count++;
if ($FP = fopen ($TextFile, "w")){
fwrite ($FP, $Count);
fclose ($FP);
}

?>


I dont suggest to use the Database though

This post has been edited by electron: Jul 28 2006, 03:06 PM
Go to the top of the page
 
+Quote Post
shahhitesh10
post Jul 26 2006, 06:31 PM
Post #5


Newbie [Level 1]
*

Group: Members
Posts: 15
Joined: 7-July 06
From: India
Member No.: 26,265



Thanks electron for the script.. but as i told you earlier i dont know php or web designing.
I just know wusiwyg editing and copy paste only. blink.gif

Can you please explain me in detail what i have to do step by step.. Whether i have to make a php file of the below script or have to paste code somewhere else etc...

Will the code below will make a table with two columns OR a table showing filename, size of file as i wrote in the first post.

Please help this ignorat person electron..

Thanks in advance
Go to the top of the page
 
+Quote Post
electron
post Jul 28 2006, 04:10 AM
Post #6


Premium Member
********

Group: Members
Posts: 162
Joined: 10-May 06
Member No.: 23,375



Well that would be a little work.
I think so u should request the Moderators to shift the topic to the PHP board.

About the script I will have to recolloect how it was to be done for the downloads.
You got to use the header function .
I will write it but i need a day or so.
Go to the top of the page
 
+Quote Post
shahhitesh10
post Jul 28 2006, 05:10 AM
Post #7


Newbie [Level 1]
*

Group: Members
Posts: 15
Joined: 7-July 06
From: India
Member No.: 26,265



Ok never mind electron.. Take your time to do the work..
But please explain the topic step by step..

To moderators: please move this topic to PHP section as i think it is a php topic.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Auto Run Java Program(11)
  2. Java Script Drop Down Menu With Css(2)
  3. [help] Java Script: Window.open(10)
  4. Java Mobile Applications(7)
  5. How To Create Java Button Or Frame(14)
  6. Java Basic Program Guidance(6)
  7. Java Helpdesk(8)
  8. Javascript : No Right Click Script !@(12)
  9. Best Java Framework For J2ee?(6)
  10. The Power Of Java(14)
  11. Jsp Or Java Chat Script Like Mig33(5)
  12. Helpful Registry Edit For Java Programmers(3)
  13. Java Iterator Help(2)
  14. Beginning Java(10)
  15. Circular Movment/animation In Java?(6)
  1. Java Applet Query(1)
  2. Java Or C++(10)
  3. Java Vs Javascript(11)
  4. Java Object[][] Help(2)
  5. Learn Java Programming Language Online Step By Step(1)
  6. Java Game(2)
  7. Call Pdf995 From Java(0)
  8. How To Implement Single Instance Application On Java(0)
  9. Java Multithreading Issues(2)
  10. Java And Xml: Links You Must Have(1)
  11. Which Is Good Java Or Dot Net(3)
  12. Java Script To Hide The Url In Address Bar(6)
  13. Need Help With Javascript Drag And Drop Script(2)


 



- Lo-Fi Version Time is now: 12th October 2008 - 03:13 AM