Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

Click here to join us on IRC (#charas on irc.freenode.net)!



  • Charas-Project »
  • Off-Topic »
  • Archive »
  • Really Old Stuff »
  • PHP (Moderator: De KoFfieŠ) »
  • MVW Counter
« previous next »
  • Print
Pages: [1]

Author Topic: MVW Counter  (Read 3936 times)

Offline GaryCXJk

  • <strong>Official Charas.EX Team Member</strong>
  • Exemplar
  • *
  • Posts: 1,586
  • FOUR OH FOUR'D
    • Multiverse Works
MVW Counter
« on: May 01, 2004, 07:17:10 PM »
Well, just a basic counter I made in PHP. Problem: no IP check.
Logged

Play it now! Charas Breakout DX
Area91: for MUGEN and RPG Maker VX Ace stuff

Offline GaryCXJk

  • <strong>Official Charas.EX Team Member</strong>
  • Exemplar
  • *
  • Posts: 1,586
  • FOUR OH FOUR'D
    • Multiverse Works
(No subject)
« Reply #1 on: May 01, 2004, 07:22:22 PM »
Okay, update. Now it will be recorded with a cookie.
Logged

Play it now! Charas Breakout DX
Area91: for MUGEN and RPG Maker VX Ace stuff

Offline GaryCXJk

  • <strong>Official Charas.EX Team Member</strong>
  • Exemplar
  • *
  • Posts: 1,586
  • FOUR OH FOUR'D
    • Multiverse Works
(No subject)
« Reply #2 on: May 01, 2004, 07:26:32 PM »
Okay, fix. Made a small mistake.
Logged

Play it now! Charas Breakout DX
Area91: for MUGEN and RPG Maker VX Ace stuff

Offline Alex

  • I am the MASTER!
  • Administrator
  • Exemplar
  • *
  • Posts: 1,130
(No subject)
« Reply #3 on: May 01, 2004, 07:34:08 PM »
Just 2 suggestions.

1) You used

if (!$_COOKIE['countercookie']) {
  blahblah
  setcookie("countercookie", 1, time()+3600*24);
}

Maybe better this:

if (!$_COOKIE['countercookie']) {
  blahblah
  setcookie("countercookie", 1);
}

This way the cookie will expire at the end of the session (when the browser closes).
After all, in a shared computer your counter would miss every other connecton during the day!

2) You may also like to know the hit rating.

if (!$_COOKIE['countercookie']) {
  blahblah
  setcookie("countercookie", 1, time()+3600*24);
} else {
  increase the counter in a 2nd file, for example $id-hits
}

Not necessary, but fun! ;)
Logged

Offline GaryCXJk

  • <strong>Official Charas.EX Team Member</strong>
  • Exemplar
  • *
  • Posts: 1,586
  • FOUR OH FOUR'D
    • Multiverse Works
(No subject)
« Reply #4 on: May 01, 2004, 07:49:43 PM »
Well, I did the first change, but the second one was a bit useless.

I did however add a new file: the alternate numbers tutorial.
Logged

Play it now! Charas Breakout DX
Area91: for MUGEN and RPG Maker VX Ace stuff

Offline Alex

  • I am the MASTER!
  • Administrator
  • Exemplar
  • *
  • Posts: 1,130
(No subject)
« Reply #5 on: May 02, 2004, 08:06:50 AM »
Well, simple but functional! ;)
Logged

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Off-Topic »
  • Archive »
  • Really Old Stuff »
  • PHP (Moderator: De KoFfieŠ) »
  • MVW Counter
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum