Jump to content

1 day IP block?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Zapper

Zapper

    Newbie

  • Members
  • PipPip
  • 12 posts
Hi, I'm looking for a way to check if an IP has done an action in the past day. I can use MySQL to store the IPs, but I need a way to check if its done the action in the past day. I am making a 'pet link' system, kind of like pokeplushies.com, but the part I'm having trouble keeping someone from refreshing the page over and over to get their pet to the highest level.

I'm kinda a newbie at PHP, so bear with me, please.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
You will need to store the IP and last date/time logged in. When someone hits the page, select the date/time and compare it with now.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
To get an ip address, you can use the remote_addr super global - $_SERVER['REMOTE_ADDR']

#4
Zapper

Zapper

    Newbie

  • Members
  • PipPip
  • 12 posts
Thanks, I'm implementing this now. I'm really happy for how this is turning out for my first project in PHP.