![]() |
| Home | Demo | Services | Features | Help | User Forum | Blog | About | |
|
#1
|
|||
|
|||
|
Hi,
I use Blogger to run my weblog; I have to sign in to their site and all, directly. Anyway, it appears to be CSS coding in my template and I was wondering if there is any coding that I can add in to said template, that will block some IP addresses. I really don't now squat about this and my Google searches were incredibly confusing... It seems like a lot of people add the code to a directory, which I don't have as a Blogger user... Just my template. IS there another option that I could use? Thanks, ahead of time! |
|
#2
|
|||
|
|||
|
Here's something that may work if they have javascript enabled, which they probably do. I don't know whether it will work on blogger, because it requires interaction with the server.
Copy and paste the script into the head of the page then change 'xxx.xxx.xxx.xxx' to their ip address. This script is only good for blocking one ip address. It would have to be modified if you wanted to block more than one. If you can't edit the head section of the page it can also be placed just after the opening body tag <body> <script language="javascript" type="text/javascript"> <!-- var ip = '<!--#echo var="REMOTE_ADDR"-->'; if (ip == "xxx.xxx.xxx.xxx") { alert("You are visiting this site from a blocked IP address " +ip); window.location="http://www.aol.com" } // --> </script> John Last edited by webado; 12-17-2005 at 07:36 AM. Reason: code got changed in forum conversion to VB |
|
#3
|
|||
|
|||
|
Thank you!!
What about the aol.com line at the end? Why is that there? Does that need modification on my behalf? I should also mentioned that I just signed up for the free version of Movable Type/Type Pad. Hopefully they'll let me have more entensive IP blocking capabilities... |
|
#4
|
|||
|
|||
|
The aol reference is where the visitor is sent after the script checks their ip address. You can change this to anything you want as long as it is a valid web address.
John |
|
#5
|
||||
|
||||
|
Quote:
__________________
Christina >>Forum Moderator<< Please do not PM me for support. The forum is here for that. |
|
#6
|
|||
|
|||
|
Quote:
If you want to include more than one ip address you would change this in the script [code]if (ip == "xxx.xxx.xxx.xxx" || ip == "xxx.xxx.xxx.xxx")[/code] For those not familiar with JavaScript, the vertical bars ( || ) are called pipes. Two of them together like this stands for the OR operand in JavaScript. You could include a few ip addresses this way. John |
|
#7
|
|||
|
|||
|
Send them to a site that you know contains trojans if you really don't like them.
__________________
I have no social life, I dribble a lot and forget things. By the way I dribble a lot and forget things. Now where was I?? |
|
#8
|
|||
|
|||
|
Thanks; now I know how to ban multiple addresses.
|
|
#9
|
|||
|
|||
|
Do you have access to a control panel with IP deny or access to allow a .htaccess file?
__________________
I have no social life, I dribble a lot and forget things. By the way I dribble a lot and forget things. Now where was I?? |
|
#10
|
||||
|
||||
|
Are you able to see that script exactly as entered in the body of your blog when you view the source?
You should post a link to your blog so we can take a look. It's of course also possible that the visitor you are trying to ban has a different Ip address from what you are trying to block.
__________________
Christina >>Forum Moderator<< Please do not PM me for support. The forum is here for that. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|