Forum Moderators: open
[webmasterworld.com...]
It shows two working codes for banning an IP address using javascript.
<script language="javascript">
// ip Redirect
var ip = '<!--#echo var="REMOTE_ADDR"-->' // ** Do Not Modify This Line **
if (ip == '00.00.00.00') {
alert("ACCESS DENIED!");
if (confirm("You are not authorized to view this web site!"))
{location.href="http://www.example.com/security.html" }
else
{ ("ACCESS DENIED!");
{location.href="http://www.example.com/security.html" }} }
</script>OR
<script type="text/javascript">
// ip Redirect
var ip = '<!--#echo var="REMOTE_ADDR"-->' // ** Do Not Modify This Line **
if (ip == '00.00.00.00') {window.location.replace("http://www.example.com/security.html")
}
</script>
I cannot get these to work. I've tried both. I've moved them around; before and after <html> or <body> but no luck. I'm also using a free message board style service that runs on asp. Could this be causing my problem?
Edit: Now that I look at it, the server probably doesn't allow SSI (Server side includes)
I think you can obtain IP address with Javascript only if java machine is up. But much users didn't have it. And better way to obtain ip address with a server side programming)
It will just be a simple matter of comparing the input boxe's value with a hrad-coded string, and possibly redirecting.
Meanwhile, about the first post, did you try saving the page with the extension: .shtml
?
"Runs on ASP" - Can you create these ASP pages yourself on your host?
<div class="commentblock" id="<bloghorn:templates:comment:id />">
<bloghorn:templates:comment:delete:button />
<bloghorn:templates:comment:time />
<b><bloghorn:templates:comment:url:orname /></b>
<bloghorn:templates:comment:admin>
(<bloghorn:templates:comment:ipaddress />)
</bloghorn:templates:comment:admin><hr>
<table>
<tr>
<td valign=top><bloghorn:templates:comment:image /></td>
<td valign=top><bloghorn:templates:comment:text /></td>
</tr>
</table>
</div>
<br/>
bloghorn is the service i'm using.
id="<bloghorn:templates:comment:id />"> may be what I'm looking for.