...

View Full Version : Blocking A computer.



Lessur
02-09-2006, 02:35 PM
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? :confused:

meediake
02-09-2006, 03:18 PM
there is some possibilities, the most simple is probably using a cookie.


//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


if($_COOKIE["banned"]==1)
{
echo"Go to hell";
}

degsy
02-09-2006, 03:44 PM
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.

Lessur
02-09-2006, 05:09 PM
the script dosent seem to be setting cookes tho

marek_mar
02-09-2006, 06:03 PM
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.

Lessur
02-09-2006, 06:12 PM
How can I make a cookie that dosent expire then?

marek_mar
02-09-2006, 06:13 PM
http://www.php.net/setcookie

Lessur
02-09-2006, 06:28 PM
ok, I have:


<?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:


<?php

if($_COOKIE["cookie_stuff150964"])
{
echo"You have been banned";
}

?>

It's not working though.... :confused:

Do I have to create a file or something?

felgall
02-09-2006, 11:20 PM
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.

Lessur
02-10-2006, 12:30 AM
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?

Extreme43
02-10-2006, 11:04 AM
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.

Lessur
02-10-2006, 07:45 PM
Ok, well, now I just want to be able to know how to set cookies.

_Aerospace_Eng_
02-10-2006, 08:56 PM
Read this (http://www.joe2torials.com/view_tutorial.php?view=64).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum