Page 1 of 1

Getting total numbers from 2 ccount's on same pages

Posted: Wed Jun 07, 2006 8:52 pm
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 ???

Posted: Thu Jun 08, 2006 11:06 am
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>

Posted: Thu Jun 08, 2006 11:36 am
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