Forum Topic: PHP: Counting unique hits

(994 views • 20 replies)

This topic is 1 page long.

<< < > >>
None

Rellizate

Reply To Post Reply & Quote

Posted at: 4/17/06 06:56 AM

Rellizate EVIL LEVEL 08

Sign-Up: 02/27/06

Posts: 480

For the tut, see here: http://www.thesmurk...?page=vtut&id=47

Sorry about having to link.


None

citricsquid

Reply To Post Reply & Quote

Posted at: 4/17/06 07:08 AM

citricsquid DARK LEVEL 23

Sign-Up: 06/25/05

Posts: 16,128

Thankyou thankyou thankyou thankyou <3

I have been looking for a good tutorial on this <3 this will really help me, thankyou so much, and good tutorial.


None

Rellizate

Reply To Post Reply & Quote

Posted at: 4/17/06 07:15 AM

Rellizate EVIL LEVEL 08

Sign-Up: 02/27/06

Posts: 480

That's ok. I was looking for one like this for ages, which is I learnt PHP, and wrote it.

:-D


None

Pilot-Doofy

Reply To Post Reply & Quote

Posted at: 4/17/06 11:11 AM

Pilot-Doofy NEUTRAL LEVEL 37

Sign-Up: 09/13/03

Posts: 12,274

lol This cat asked me for help on this tutorial making process. Anyway, why would you use a database for such small things like this? A txt file would really be all you need.


None

NinoGrounds

Reply To Post Reply & Quote

Posted at: 4/17/06 12:16 PM

NinoGrounds EVIL LEVEL 17

Sign-Up: 11/28/05

Posts: 3,758

At 4/17/06 11:11 AM, Pilot-Doofy wrote: lol This cat asked me for help on this tutorial making process. Anyway, why would you use a database for such small things like this? A txt file would really be all you need.

However you are right, I am saving it the DB as well.

But my script is ALOT smaller, and, because of it, faster.


None

Rellizate

Reply To Post Reply & Quote

Posted at: 4/17/06 12:26 PM

Rellizate EVIL LEVEL 08

Sign-Up: 02/27/06

Posts: 480

At 4/17/06 11:11 AM, Pilot-Doofy wrote: lol This cat asked me for help on this tutorial making process. Anyway, why would you use a database for such small things like this? A txt file would really be all you need.

Well, mostly because I wanted to practice my SQl.

:D


None

NinoGrounds

Reply To Post Reply & Quote

Posted at: 4/17/06 12:32 PM

NinoGrounds EVIL LEVEL 17

Sign-Up: 11/28/05

Posts: 3,758

At 4/17/06 12:26 PM, Rellizate wrote:
At 4/17/06 11:11 AM, Pilot-Doofy wrote: lol This cat asked me for help on this tutorial making process. Anyway, why would you use a database for such small things like this? A txt file would really be all you need.
Well, mostly because I wanted to practice my SQl.

D

You want me post mine version? If you want to I'll do it.


None

Rellizate

Reply To Post Reply & Quote

Posted at: 4/17/06 12:35 PM

Rellizate EVIL LEVEL 08

Sign-Up: 02/27/06

Posts: 480

No thanks. I know yours will be better, so there is no point...

xD


None

NinoGrounds

Reply To Post Reply & Quote

Posted at: 4/17/06 12:44 PM

NinoGrounds EVIL LEVEL 17

Sign-Up: 11/28/05

Posts: 3,758

At 4/17/06 12:35 PM, Rellizate wrote: No thanks. I know yours will be better, so there is no point...

xD

Ok...but it is like:
1) GET IP
2) Check if the same one already in the db
3) if no, insert it
4) else do nothing (but there's no actually part like else {} )


None

Rellizate

Reply To Post Reply & Quote

Posted at: 4/17/06 12:45 PM

Rellizate EVIL LEVEL 08

Sign-Up: 02/27/06

Posts: 480

That's exactly what mine does.


Thinking

Zendra

Reply To Post Reply & Quote

Posted at: 4/17/06 01:49 PM

Zendra NEUTRAL LEVEL 41

Sign-Up: 09/07/03

Posts: 12,503

At 4/17/06 12:26 PM, Rellizate wrote: Well, mostly because I wanted to practice my SQl.

Better do that in your own time. ;)
You need to give people the best solution which is fast and secure - if you'd ask me.

NG BBS & Review moderator // PM abuse // Check my audio!


None

Ziaja

Reply To Post Reply & Quote

Posted at: 4/17/06 07:04 PM

Ziaja NEUTRAL LEVEL 02

Sign-Up: 10/02/05

Posts: 456

I think this was ment to be an affiliate in/out counter (at least thats what i gather from the comment he left).

Obnoxious2ombie.com - Online Drug Lord!


None

thoughtpolice

Reply To Post Reply & Quote

Posted at: 4/17/06 08:19 PM

thoughtpolice DARK LEVEL 10

Sign-Up: 03/24/03

Posts: 3,101

At 4/17/06 12:16 PM, Nino_JoJ wrote: However you are right, I am saving it the DB as well.

But my script is ALOT smaller, and, because of it, faster.

A smaller script doesn't me flat out anything - my entire website is run off of five lines of PHP, but that doesn't mean it's going to work any faster than somethingawful.

omg.
Playstation Network tag: muffin-noodle
the empty set


None

Rellizate

Reply To Post Reply & Quote

Posted at: 4/18/06 10:54 AM

Rellizate EVIL LEVEL 08

Sign-Up: 02/27/06

Posts: 480

At 4/17/06 07:04 PM, Ziaja wrote: I think this was ment to be an affiliate in/out counter (at least thats what i gather from the comment he left).

Well, it only counts in. Also this was actually created for seeing how many unique hits, sites which you bought advertising off sent you.
You can use it for lots of stuff, though.


None

Rellizate

Reply To Post Reply & Quote

Posted at: 4/18/06 11:16 AM

Rellizate EVIL LEVEL 08

Sign-Up: 02/27/06

Posts: 480

Ok, fixed.

Change line in add_new.php where it says:
$result = mysql_query("select * from supporters limit 1");

to:
$result = mysql_query("SELECT id FROM supporters ORDER BY id DESC LIMIT 1");


Happy

netster403

Reply To Post Reply & Quote

Posted at: 4/18/06 11:39 AM

netster403 NEUTRAL LEVEL 09

Sign-Up: 07/31/03

Posts: 1

sweetness, always looking for php goodies, thank ya kindly :P


None

Rellizate

Reply To Post Reply & Quote

Posted at: 4/18/06 02:53 PM

Rellizate EVIL LEVEL 08

Sign-Up: 02/27/06

Posts: 480

That's ok.

Remember to:

change line in add_new.php where it says:
$result = mysql_query("select * from supporters limit 1");

to:
$result = mysql_query("SELECT id FROM supporters ORDER BY id DESC LIMIT 1");


None

knugen

Reply To Post Reply & Quote

Posted at: 2/16/07 03:26 PM

knugen LIGHT LEVEL 35

Sign-Up: 02/07/05

Posts: 4,707

The link is broken :'(


None

Mister-Mind

Reply To Post Reply & Quote

Posted at: 2/16/07 03:34 PM

Mister-Mind EVIL LEVEL 07

Sign-Up: 07/01/06

Posts: 2,196

At 2/16/07 03:26 PM, DreamworX wrote: The link is broken :'(

Yuppers,

Im going to pm the thread starter asking if he can make another thread and called php: counting unique hits and he can remake the tut, and replace it in the PHP Main


None

knugen

Reply To Post Reply & Quote

Posted at: 2/16/07 03:36 PM

knugen LIGHT LEVEL 35

Sign-Up: 02/07/05

Posts: 4,707

At 2/16/07 03:34 PM, PHPgeek wrote: Im going to pm the thread starter asking if he can make another thread and called php: counting unique hits and he can remake the tut, and replace it in the PHP Main

Ok, do you think that you could PM me if he does so? Thanks :)


None

juraj

Reply To Post Reply & Quote

Posted at: 2/16/07 05:11 PM

juraj LIGHT LEVEL 29

Sign-Up: 05/15/04

Posts: 1,190

Counting unique hits isn't so tough to set-up. You just need a MySQL database and an idea what you're trying to accomplish :-)

BTW, what is exactly considered an unique hit? A single request from an IP address in 24 hours?


All times are Eastern Standard Time (GMT -5) | Current Time: 12:35 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!