i need to stop users to visting the same page

Discussion in 'Programming' started by dadyal, Jan 28, 2010.

  1. #1
    i need to stop users to visting the same page after 10 time any php code ?
     
    dadyal, Jan 28, 2010 IP
  2. The Men

    The Men Peon

    Messages:
    44
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Create a cookie ( first visit ) and compare it against the time().
     
    The Men, Jan 28, 2010 IP
  3. codebreaker

    codebreaker Well-Known Member

    Messages:
    281
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    110
    #3
    This is one of the oldest php problems : How do i stop a user to access a page.
    There are multiple solutions but none of them it's perfect.
    1. Create a cookie and then compare it with time();
    Problem : The user can easily delete the cookie and access the page.
    2. Store their ip in a database( ip + time of access ) and compare their current ip and time with the database.
    Problem : The user can use proxies . But this solution should keep average Joe away from your page.
    You can make it even more complicated and check if the user it's using a proxy, but that's a bit more hard to do.
    Codebreaker
     
    codebreaker, Jan 29, 2010 IP
  4. dadyal

    dadyal Active Member

    Messages:
    162
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #4
    i dont know how to code

    pleas give me a code so i can put in my site

    both php + cokie
     
    dadyal, Jan 29, 2010 IP
  5. hhelen

    hhelen Member

    Messages:
    352
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    33
    #5
    It is not hard to implement this, problem is how do you determine if your users are accessing your page more than 10 times for good reason? I don't programme in PHP, but if you can read a Python script let me know and I can knock one up for you.
     
    hhelen, Jan 29, 2010 IP
  6. dadyal

    dadyal Active Member

    Messages:
    162
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    53
    #6
    its a ptc site i want to stop them refreshing the ads vist page more then a limt

    i am not a programer
     
    dadyal, Jan 29, 2010 IP