Jump to content

Birdofprey

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Birdofprey's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. [!--quoteo(post=369410:date=Apr 27 2006, 08:38 PM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ Apr 27 2006, 08:38 PM) [snapback]369410[/snapback][/div][div class=\'quotemain\'][!--quotec--] you don't really need either. just make another column in the database (or format your text file if you wanna go that route, but i'll use the db example) named like ipaddress or something. then, all you have to do is when the hit counter script runs, see if the user's ipaddress is already on the list. if it is, then do not increment the counter. if it is not, then increment the counter and insert the ip address onto the list. [/quote] if I put the ip onto the list, it will be there forever, no? what if I want is count a unique ip every 24 hours?
  2. [!--quoteo(post=369118:date=Apr 27 2006, 01:04 AM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ Apr 27 2006, 01:04 AM) [snapback]369118[/snapback][/div][div class=\'quotemain\'][!--quotec--] in the end, it's mostly just a matter of preference whether you want to store the number in a sql database or a text file, for something that simple. as far as sessions are concerned, it depends on how restricted you want your counter to be. do you want it to go up every time any random person views the page, even if they keep clicking the refresh button, or do you want it to only increment for unique users (ip addresses)? do you want the counter to be user specific (as in, "you have viewed this page x amount of times, Richard") ? [/quote] at first I wanted to just display amount of times page was viewed, but then I realized anyone should just refresh the page over and over and just increase the number, which then seems like a foolish idea because it whould be a unnesscary waste of server's resources. Now, I decide that I want to count only unique ips, lets say every 12 hours or so. Could I still use sessions, or now I would have to go into cookies?
  3. how do you even program a game with php? unless it's a math game.
  4. [!--quoteo(post=369031:date=Apr 26 2006, 05:59 PM:name=DepretioN)--][div class=\'quotetop\']QUOTE(DepretioN @ Apr 26 2006, 05:59 PM) [snapback]369031[/snapback][/div][div class=\'quotemain\'][!--quotec--] Write the value to a text file. Each hit, pull the value from the text file, increment it, put it back in the text file. [/quote] Why this approach? I've looked at many simple hit counter script, majority of which uses text based, but I don't want to use it because I would end up with a bunch of txt files.
  5. Which is the best approach? I queue a mysql table with current hits number, let say 3. do num++ whenever a page loads. And add the current number back to the table. Or Use session to record the pageview and add it to the table? If I were to use session where I begin since I never had any experience with sessions.
  6. [code] SELECT * FROM table WHERE DATE_SUB(CURDATE(), INTERVAL 30 DAY) <= 'Date' Order By 'Date' DESC Limit 14 [/code] Hi, I'm using this to get the most recent 30 entires, but it also gives me future entries which hasn't arrive yet. Is there a way for me to query it so that only the current date and the last 30 days are called and not the future entires?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.