homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

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

10+ Year Member

Msg#: 3473033 posted 7:26 pm on Oct 9, 2007 (gmt 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?


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved