Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

How to add ip's to htaccess with deny from infront of it.?

7:26 pm on Oct 9, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 3, 2005
posts: 187
votes: 0


sometimes it can be handy to add a large block of ip's to the htaccess file.
But if you add 30 ip's to the htaccess you have to add deny from all the time..

Now...i found the following script...

<script language="Javascript">
function xmlhttpPost(strURL) {
var xmlHttpReq = false;
var self = this;
// Mozilla/Safari
if (window.XMLHttpRequest) {
self.xmlHttpReq = new XMLHttpRequest();
// IE
else if (window.ActiveXObject) {
self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
self.xmlHttpReq.open('POST', strURL, true);
self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
self.xmlHttpReq.onreadystatechange = function() {
if (self.xmlHttpReq.readyState == 4) {

function getquerystring() {
var form = document.forms['f1'];
var word = form.word.value;
qstr = 'w=' + escape(word); // NOTE: no '?' before querystring
return qstr;

function updatepage(str){
document.getElementById("result").innerHTML = str;
<form name="f1">
<textarea id="word" style="width: 410px; height: 191px"></textarea>

<input value="Go" type="button" onclick='JavaScript:xmlhttpPost("/cgi-bin/simple-ajax-example.cgi")'></p>
<div id="result"></div>

So my idea was to put in a bunch of ip's in the text area..
That goes ok...

Other part of the script is a tiny cgi part....


And thats :

#!/usr/bin/perl -w
use CGI;

$query = new CGI;
$secretword = $query->param('w');

print $query->header;
print "<pre>$secretword</pre><br>";


When i put ip's in it shows like :

it shows afterwards like :

Thats fine,but i tried to change the code (probably cgi part) to show it like :

deny from
deny from
deny from

But i cant seem to get it right...
Anyone that can assist with that?