|
|
|
|
![]() ![]() |
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 |
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. |
|
|
|
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. |
|
|
|
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.. Could you please explain me in detail step by step how to do this.. I have a mysql database.. Thanking u in advance. |
|
|
|
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 |
|
|
|
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. 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 |
|
|
|
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. |
|
|
|
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. |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 12th October 2008 - 03:13 AM |