Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13
  1. #1
    New Coder
    Join Date
    Feb 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Blocking A computer.

    How can I make it so if a certain computer(s) come to my website they will re-directed to a certain page? The person that I want to do this with has a router, so he has a different IP adress every time he turns it off then back on.

    Is this still possible though?

  • #2
    New Coder
    Join Date
    Nov 2003
    Location
    PHP-LAND
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    there is some possibilities, the most simple is probably using a cookie.
    PHP Code:
    //if user visits your site and performs something that is not allowed
    setcookie("banned"1); 
    and when he comes back, you just check his cookie
    PHP Code:
    if($_COOKIE["banned"]==1)
    {
      echo
    "Go to hell";


  • #3
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Depends on how you define certain computers. Do you mean by IP Address? If so you would need to know the IP and if it was unique incase you block a group of users.

  • #4
    New Coder
    Join Date
    Feb 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    the script dosent seem to be setting cookes tho
    Last edited by Lessur; 02-09-2006 at 05:22 PM.

  • #5
    Senior Coder
    Join Date
    Aug 2003
    Location
    One step ahead of you.
    Posts
    2,815
    Thanks
    0
    Thanked 3 Times in 3 Posts
    It is not really possible to do it. For all means of blocking someone I know I also know how to bypass it.

    That cookie will expire when the browser closes.
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.

  • #6
    New Coder
    Join Date
    Feb 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How can I make a cookie that dosent expire then?

  • #7
    Senior Coder
    Join Date
    Aug 2003
    Location
    One step ahead of you.
    Posts
    2,815
    Thanks
    0
    Thanked 3 Times in 3 Posts
    I'm not sure if this was any help, but I hope it didn't make you stupider.

    Experience is something you get just after you really need it.
    PHP Installation Guide Feedback welcome.

  • #8
    New Coder
    Join Date
    Feb 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok, I have:

    Code:
    <?php
    $value = 'cookie_stuff150964';
    
    setcookie("cookie_stuff150964", $value, time()+60*60*24*30, "/main", ".blue-pelican.net");  /* expire in 30 days */
    ?>
    An then on my homepage I have:

    Code:
    <?php
    
    if($_COOKIE["cookie_stuff150964"])
    {
      echo"You have been banned";
    }
    
    ?>
    It's not working though....

    Do I have to create a file or something?

  • #9
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,642
    Thanks
    0
    Thanked 649 Times in 639 Posts
    Of course since the cookie is on their computer they can easily delet it. They may even have their computer set to not save it in the first place.

    The web is basically anonymous so you can't guarantee that you can identify the same person a second time.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

  • #10
    New Coder
    Join Date
    Feb 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmm, well, id kinda like to beable to set cookes anyway, I could do a lot.

    Is there anything wroung with the script that I posted the last post I made?

  • #11
    New Coder
    Join Date
    Mar 2005
    Posts
    98
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you could block the subnet?
    Any address that includes 111.111.111.xxx (ip address of user you want out)
    get redirected.
    Although if they really want to get in they could easily get onto a proxy.
    or use a public computer.
    it really isnt possible to stop somebody getting to your page without blocking everyone else.

  • #12
    New Coder
    Join Date
    Feb 2006
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, well, now I just want to be able to know how to set cookies.

  • #13
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Read this.
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •