Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jan 2011
    Posts
    76
    Thanks
    8
    Thanked 0 Times in 0 Posts

    Angry Breaking Out of iframe by ip address

    Hi there, i really could use the help.

    Ok, so (and im sure i will be told other ways) i have come up with a way of blocking people from my site even if they are currently on the site and dont reload the page.

    What i was thinking of is simply:
    a tiny iframe on the bottom of my page, so small it cant be seen ie 1px
    that iframe goes to a page saying YOU HAVE BEEN BANNED

    That page istself will be on a constant 10 seccond refresh so as soon as i add the ip address to it, BOOM, it will break out of the iframe and take the user away from the main page as display the you have been banned message.

    Sound good?


    ok, so here is what i have sofar but i know its wrong, dont really know how to write it correctly. The main point is:

    if ip is 111.111.111 then break out of iframe

    else

    do nothing.


    Thanks for the help.

    Code:
    <script language="JavaScript">
    VIH_ForeColor = "navy";
    VIH_FontPix = "16";
    VIH_DisplayFormat = "%%IP%%";
    VIH_DisplayOnPage = "no";
      </script>
            <script language="JavaScript" src="http://scripts.hashemian.com/js/visitorIPHOST.js.php"></script>
            
            <script language="JavaScript" src="http://scripts.hashemian.com/js/visitorIPHOST.js.php"></script>
          <script>
    if (VIH_HostIP == "111.111.111.111")
    
    document.write('if (top.location!= self.location) {
    			top.location = self.location.href
    		}' );
    }else{
     document.write('');
    ;}
        </script>

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,312
    Thanks
    58
    Thanked 525 Times in 512 Posts
    Blog Entries
    5
    Try posting that in the HTML or JAVASCRIPT forum!
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #3
    New Coder
    Join Date
    Jan 2011
    Posts
    76
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tangoforce View Post
    Try posting that in the HTML or JAVASCRIPT forum!

    My bad, sorry! Can i remove it from here or shall i just leave it?

  • #4
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,312
    Thanks
    58
    Thanked 525 Times in 512 Posts
    Blog Entries
    5
    Click the edit button and then on the edit form hit delete.
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •