Getting total numbers from 2 ccount's on same pages

Post your Click counter digestion problems here
Post Reply
Jesper Møller
Posts: 8
Joined: Thu May 25, 2006 5:16 pm

Getting total numbers from 2 ccount's on same pages

Post by Jesper Møller »

Script URL: http://www.jart.dk/jgom/componenter/ccounter/
Version of script: PHP Click counter 1.1
Version of PHP:
Hosting company:
Have you searched THIS FORUM for your problem: yes
(if not please do before posting)
If so, what terms did you try:

Write your message below:

I have made a page wher i use the click counter 2 times. I have made a "acounter" and a "econter" to the 2 sections of downloads i have on the pages. and all is working well
However i now hav a problem on my info page where i want to show the total numbers of downloads form section a and e
Calling the to scripts is easy:
< script type="text/javascript" src="componenter/acounter/display.php"><!--
//-->
< /script>
< script type="text/javascript" src="componenter/ecounter/display.php"><!--
//-->
< /script>

But when i shall show the results it gets tricky:
acount=
< script type="text/javascript">var all = ccount_link[1]+ccount_link[2]+ccount_link[3]+ccount_link[4]+ccount_link[5]+ccount_link[6]+ccount_link[7]+ccount_link[8]; document.write(all);< /script>

ecount=
< script type="text/javascript">var all = ccount_link[1]+ccount_link[2]+ccount_link[3]+ccount_link[4]; document.write(all);< /script>

????
This dont work

How can i do it ???
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

THe problem is probably that you have the same variable names in both scripts. Try renaming the javascript variables for one script (inside display.php), for example to add "2" to all variables:

< script type="text/javascript">var all2 = ccount2_link[1]+ccount2_link[2]+ccount2_link[3]+ccount2_link[4]; document.write(all2);< /script>
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Jesper Møller
Posts: 8
Joined: Thu May 25, 2006 5:16 pm

Post by Jesper Møller »

THe problem is probably that you have the same variable names in both scripts.
That was what i was thinking, but dident know wher to edit the php ...
Ill try to play with it...

Thanks
Post Reply