Forum Moderators: coopster

Message Too Old, No Replies

How can I

         

cameraguy

6:57 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



I have developped a web counter that displays visitors by country. I would like to be able to offer it to other users/bloggers.

I am thinking about a single line that would 'call' my script (let's name it counter.php) and execute it locally. I would obviously have to pass a variable identifying the user.

Could someone suggest a solution?

Thank you!

Roberto

Burner

10:54 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



Wow,

This could get to be a loaded question real fast. How are you storing the counter for each user? Are you using an SQL server of some sort for this and/or the country database? If you are, then it seems to me this would be as simple as another SQL table for each user account and passing a unique record id for each account on the url line.

yoursite.com/counter.php?account=1

As for displaying the output on someone else's website, you'll either need to output a graphic representing the number and let them reference it as an image file coming from your website, or you would need to enclose your output in an iframe.

My 2 cents,
Burner

cameraguy

8:02 am on Jun 24, 2005 (gmt 0)

10+ Year Member



Thanks Burner.

Actually, that's what I am doing. The problem is that my solution is generating an awful lot of server queries (not mysql queries) and it's eating up all my bandwith.

Right now users simply have to insert in their web page a script like this one:

<script language="javascript" src="http://www.abc.net/counter.php?user_counter=12345"> </script>

I was wondering whether there is an different solution, one that would return an html script with the counter layout rather than the 'executed' counter (the image of the counter). Because right now I believe the counter (with the numerous country flags) is executed at my server level thus taxing my bandwith.

Burner

8:27 am on Jun 24, 2005 (gmt 0)

10+ Year Member




I was wondering whether there is an different solution, one that would return an html script with the counter layout rather than the 'executed' counter (the image of the counter). Because right now I believe the counter (with the numerous country flags) is executed at my server level thus taxing my bandwith.

Script output of a graphic file is the same as feeding a graphic file, so yes, it is. I wish I had a good answer for that one. How big is your graphic at output? Are you using png, jpg, or gif to output? My thinking on it is this:

1. text converted to png is crisper, but larger file size than jpg
2. you could use a small nicely formatted HTML output and use zlib compression to save bandwidth
3. On your imagejpeg or imagepng you could try lowering the quality parameter a bit. It defaults to 75 if not set.
4. If everything is only a few kb per and it's killing your bandwidth, you may just be wildly popular and need to add more bandwidth!

Just my thoughts,
Burner