|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I just created a counter in PHP, and was wondering how I would be able to make other websites (which are located on different servers) of mine be able use the same statisitcs/counter. If you don't get my drift, I am almost trying to accomplish a remotely hosting counter service.
Counter Info There are two files: counter.php, counterlog.txt If a visitor comes, it opens up the counterlog.txt and it increments. I put an include statement where I want the counter to show. Can you guys help me by answering these questions: 1. What language would I use? 2. Would I call it with JavaScript's script src? If you want, you could also be so kind to write me the script (or at least some of it) ![]() |
|
#2
|
||||
|
||||
|
if the other peoples sites have php you can just do <? include("http://www.yoursite.com/counter.php"); ?> on the pages you want to increment a counter...
If you want to have different counters for different sites, I suggest you do the following: 1. create a folder called "counterlog" 2. replace "counterlog.txt" with "counterlog/" . $_GET['site'] . "_log.txt" 3. create text files like "www.mysite.com_log.txt" for each site, changing the domain each time. 4. include on the site: <? include("http://www.yoursite.com/counter.php?site=www.mysite.com"); ?> hope that helps, computer |
|
#3
|
|||
|
|||
|
i want people who have hosts that don't support php to be able to use it as well.
|
|
#4
|
||||
|
||||
|
well use server side includes or javascript includes then
|
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > Hit Counter Help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|