Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7898091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:20:24+00:00 2026-06-03T08:20:24+00:00

I have to block out a certain div for a certain IP addresss I

  • 0

I have to block out a certain div for a certain IP addresss
I am using asp here is the code:

 <%
Dim sBlockedIP
sBlockedIP = Request.ServerVariables("REMOTE_ADDR")
'check if the IP is the one that is blocked
If sBlockedIP = "00.000.00.00" Then
'if IP address is banned then redirect to no_access.asp
Response.Redirect "no_access.asp"
End If
%> 

this is the html that needs to be blocked to this IP

    <div id="social_media_outer">
      <div id="social_media">
      <div id="fb-root"> <script src="#">
      </script><fb:like href="" send="true" layout="button_count" 
show_faces="false" action="recommend" border="6" font="">
      </fb:like>
      <span  class='st_linkedin' >
      </span></span>
      <span  class='st_facebook' >
      </span>
      <span  class='st_sharethis' st_title="#"></span>
      <a href="http://twitter.com/share" data-count="none"><img src="#" style="position:relative;
      bottom:-4px; border:none;" /></a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script><span class="st_email" ></span>
      <a href="javascript:print(document)"><img src="http://www.gosh.org/facebook/sharethis/print_icon.gif" style="position:relative;
      bottom:-4px; border:none;" /></a>

 </div>
</div>
</div> 

Can someone help please.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:20:26+00:00Added an answer on June 3, 2026 at 8:20 am

    First Response.Redirect is not the appropriate tool if you only wish to block a part of the generated content (and to block the whole page using IIS IP based security tools would be better than coding it).

    This would do it

     <%
          Function CanShowProtectedContent()
               CanShowProtectedContent = Request.ServerVariables("REMOTE_ADDR") <> "xxx.xxx.xxx.xxx"
          End If
     %>
    
     ...
    
     <div id="social_media_outer"> 
     <% If CanShowProtectedContent()  Then %>
        <!-- your normal content here -->     
     <% Else %>
        <span>Content unavailable</span>
     <% End If %>
     </div>
    

    Although you should consider beefing up CanShowProtectedContent to support a list of bannedIP addresses and/or subnets. Also store the set as an ASP include file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this code to make a certain div (#extras) fade out. $(document).ready(function()
I am starting out with OrchardCMS and have hit a road block (for me
I have a block of code, no complicated stuff is going on in it,
I have a block element (DIV) who stretches across an entire page. It contains
I have a block of text that im taking from a Gedcom ( Here
I have a block of code that serializes a type into a Html tag.
In one of requirement we have to make available certain attributes through out the
I have a div with a certain width and within this parent div I
I have this block of html: <div> <p>First, nested paragraph</p> </div> <p>First, non-nested paragraph.</p>
I have some HTML 5 code that starts out with two black canvases and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.