Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> How To Program A Counter?, counter for clicks on picture
darul0r
post Jan 31 2005, 03:59 PM
Post #1


Member [ Level 1 ]
Group Icon

Group: Members
Posts: 37
Joined: 31-January 05
Member No.: 2,443



hi @ all!
i have a website with many partypics.. and now i want to have a counter! if anybody clicks on a pic, the counter which is placed under everypic should notice this! so for every pic i want a counter, which shows how often it was clicked and shown!

with which scrpting language should i make it?
which is the best for this quest?

thx for help!

greetz darul0r
Go to the top of the page
 
+Quote Post
NilsC
post Jan 31 2005, 04:40 PM
Post #2


To Err Is Human, To Forgive Divine
Group Icon

Group: Members
Posts: 558
Joined: 24-December 04
From: http://www.ultimatekayakfishing.com/
Member No.: 1,871



Did you take a look at the counters on this webpage. There should be one there that you can use to count pagehits, so if you treat each picture as a page then the count will be accurate.
Hotscripts.com

I have not tried any of the scripts live uet but I have a couple that I'm testing.

Nils
Go to the top of the page
 
+Quote Post
Peg
post Jan 31 2005, 05:54 PM
Post #3


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 16
Joined: 31-January 05
Member No.: 2,449



Yeah. I have made some site counters but never got em working sad.gif
Go to the top of the page
 
+Quote Post
ChronicLoser
post Feb 1 2005, 04:12 AM
Post #4


Premium Member
Group Icon

Group: Members
Posts: 240
Joined: 13-November 04
From: Arizona
Member No.: 1,356



if all else fails, i suggest going here: http://www.digitalpoint.com/tools/counter/

it's a simple counter and doesn't require signing up or anthing. I've tried it for a day and it seemed to work fine. I ended up using my php counter instead, but this one seems to be decent ^_^
Go to the top of the page
 
+Quote Post
wanhafizi
post Feb 1 2005, 05:30 AM
Post #5


Advanced Member
Group Icon

Group: Members
Posts: 145
Joined: 13-December 04
Member No.: 1,734



i suggest you use Singapore web gallery.
goto hotscripts.com, goto the PHP section and search "Singapore". it is the best gallery script i ever used.
Go to the top of the page
 
+Quote Post
Hercco
post Feb 2 2005, 08:47 PM
Post #6


Super Member
Group Icon

Group: Members
Posts: 595
Joined: 4-September 04
Member No.: 228



QUOTE(darul0r @ Jan 31 2005, 05:59 PM)

with which scrpting language should i make it?
which is the best for this quest?
*




Apparently you wish to make the counter yourself and not use a ready made one. That's the right attitude. biggrin.gif

PHP is a good choice for language. You should make a page that is used for viewing a picture. Use a parameter at the end of the URL to identify which image is loaded. So the url to view a picture would be like: yoursite.com/viewpic.php?pic=1

The variable "pic" here can be accessed with $_GET['pic']

Then of course you need to create some kind of system to save the picture data. You could use simple the picture's name in the variable (yoursite.com/viewpic.php?pic=me.jpg) but that would mean that by changing the url you could view any picture inside yoursite. To avoid you could keep list of pictures that are allowed to be viewed there and check it everytime the page is accessed.

Other, and more sophisticated method would be to build a table, a database one if you are familiar with them (if not, it might be worth learning), where you save a unique id (an integer) for each picture. This same table could be used to save the number of time the page is accessed ie. the thumbnail is clicked.

For the actual counting, it's easy as pie. Just load the old value of clicks plus one to it and save/update database.
Go to the top of the page
 
+Quote Post
LeafH
post Apr 2 2007, 02:55 PM
Post #7


Newbie [ Level 1 ]
Group Icon

Group: Members
Posts: 9
Joined: 2-April 07
From: Taiwan
Member No.: 21,228



counters

1.CGI scripts

http://cgi.resourceindex.com/Programs_and_...ccess_Counters/

2. PHP

http://php.resourceindex.com/Complete_Scri...ccess_Counters/

you can find many interesting stuffs there.
Download the source and may modify them if you know how.

there are so many kinds of programs which can display the count invisibly
or by using text(Text based) or images(Graphical).

Go to the top of the page
 
+Quote Post
Habble
post Jun 19 2007, 05:51 AM
Post #8


Premium Member
Group Icon

Group: [HOSTED]
Posts: 274
Joined: 17-June 07
From: Tasmania
Member No.: 22,699



You should use php with mysql. Make a table with a field for the image filename, and a number of clicks, then put something like this on the page that the image takes you to.
CODE
<?php
$connection = mysql_connect("host","username","password");
mysql_select_db("database");
$select = "select clicks from table where imagename = 'Image filename';";
$sresult = mysql_query($select);
$sarray = mysql_fetch_array($sresult);
$clicks = $sarray+1;
$query = "update table set clicks = '".$clicks."' where imagename = 'Image filename';";
mysql_query($query);
mysql_close($connection);
?>

That's assuming you know the basics of PHP and MySQL. If not, I can tell you in full.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Google Adsense(23)
  2. Do You Program/code Your Own Games(11)
  3. Counter Strike Servers(17)
  4. True Free Design Program?(16)
  5. Wuts A Good Game Maker Program?(12)
  6. Microsofts Acrylic(1)
  7. Favorite Graphics Program?(64)
  8. Counter-Strike 1.6(12)
  9. Paint.NET Project - A Free Picture Editor(2)
  10. Counter-Strike Source Clans - Post Your Server IPs(15)
  11. Ideas For Using VB To Program Nokia S60 Phones(8)
  12. Which Virus-protection Program Is The Best?(18)
  13. A Free Graphic Design Program That Could Equal Photoshop?(28)
  14. Unstable Counter Strike FPS !!(8)
  15. Gba Game Program(5)
  1. Ahh! Big Mistake! How Do I Get This Program Back?(17)
  2. How To Set Up A Dedicated Server(27)
  3. Good Program To Use(8)
  4. Best Free Anti-virus Program(16)
  5. Counter Strike Server(4)
  6. Graphic Design Program(7)
  7. Uploading More Than 30 Files In Less Than 10 Clicks?(5)
  8. Best Program To Tune Up An Old Computer?(9)
  9. How Bad Are Is $0.03 For 2 Clicks On Adsense?(2)
  10. In Your Opinion, The Best P2p Program.(1)
  11. Easy Visitor Counter(3)
  12. Designing A Summer Running Program(1)
  13. C++ Meters To Feet And Feet To Meters Program(0)


 



- Lo-Fi Version Time is now: 30th August 2008 - 04:17 AM