Kaisa
04-27-2003, 06:23 PM
How do you ban ip addresses because i want to know how so i can ban flamers etc.
|
Click to See Complete Forum and Search --> : Banning IP Addresses Kaisa 04-27-2003, 06:23 PM How do you ban ip addresses because i want to know how so i can ban flamers etc. pyro 04-27-2003, 07:13 PM Many hosts have a way to do this, so you could begin with checking by them. If they do not, you will need to use server side code (PHP, CGI/Perl, ASP, etc.) to check the IP and then disallow certain IPs... Kaisa 04-27-2003, 07:17 PM oh thanks i will ask them PeOfEo 04-27-2003, 08:32 PM no, you dont need a server side, there is a simple java script that can detect an ip and redirect someone to another place if it is the banned ip, the problem is you have to know that ip first, but you can ban a whole range of ip's though so the person cant just reconnect if you know what state and city he is in. I can find an ip over aim though so getting it is no biggy. its just like open command prompt and type ping jx-fl-1-254 But once you know his p you can ban a whole range problem with this is no one from his area can view your site, but it gets rid of him doesnt it? PeOfEo 04-27-2003, 08:37 PM <script language="javascript"> var ip = '<!--#echo var="REMOTE_ADDR"-->' if (ip == '206.186.23.178') { alert("STOP! You are viewing this page from an IP address that is not allowed!"); alert("Why can't you guys just leave me alone?"); if (confirm("Do you want to leave peacefully? Or will I have to help you?")) {location.href="http://www.yahoo.com" } else { ("OK you choose I don't care! Bye bye! Don't come back!"); {location.href="http://www.yahoo.com" }} } </script> thats the code, I got this off of javascriptkit.com so no guarantees pyro 04-27-2003, 08:40 PM That's not getting the IP with javascript. That is SSI. So, you are still useing server side code, and more than likely, you page will have to be renamed to .shtml PeOfEo 04-27-2003, 08:44 PM no no no, thats banning the ip with java script, but if you know the users location you can ban a small range of ip's to insure he wont get in. You would want ssi to detect though. PeOfEo 04-27-2003, 08:46 PM var ip = '<!--#echo var="REMOTE_ADDR"-->' are you talking about that line? That is refering to the users box isnt it? Kaisa 04-27-2003, 08:48 PM i think it will work i will try it later though and can someone fix the width so no one can mess up the posts ? pyro 04-27-2003, 08:48 PM Yes, that line is using a SSI... PeOfEo 04-27-2003, 09:47 PM it wont wrap code, because if you try to wrap vb or c# or a lot of other languages it will screw it up so their is no way to fix the width sry. About that ssi, I dont think that would cause a problem, wouldnt the client be able to run that? Well java script can detect an ip so their is bound to be another way to make a client side script to ban an ip. pyro 04-27-2003, 10:54 PM No, that will not work on the client side, and the only thing that I know of that does, is in NN4 with Java enabled, so that really isn't using javasript either... webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |