Javascript help..

Discussion in 'OT Technology' started by That Robin Girl, Mar 21, 2005.

  1. That Robin Girl

    That Robin Girl Born Again Atheist

    Joined:
    Aug 29, 2002
    Messages:
    11,889
    Likes Received:
    0
    Location:
    S. Austin
    How can I do this?


    I want basically, anyone that visits a web page from a certain class C (123.240.11.*) to see a different webpage if they go to this site...


    Thanks in advance..

    :bigthumb:
     
  2. Aimless

    Aimless Resident drunkey

    Joined:
    Nov 5, 2001
    Messages:
    2,534
    Likes Received:
    0
    Location:
    Wisconsin
    I don't have a lot of time, but something like this might work...

    var ip = '<!--#echo var="REMOTE_ADDR"-->';

    Then use string/substring manipulation to remove the last octet from the IP var

    if (ipminusoctet == "123.240.11") {
    window.location="newsite.html";
    }
     
  3. keep in mind if you're doing it by javascript, you either have to write the entire document out via document.write, or perform the detect and switch on an intermediary page before the content page(s) you're switching between ... otherwise the content will definitely start rendering before detection and redirect by JS could take place.
     
  4. dk01

    dk01 Awwwwww..... OT Supporter

    Joined:
    Mar 1, 2005
    Messages:
    3,178
    Likes Received:
    0
    Location:
    All up in your interwebsnet.
    This is really not something for Javascript. Its easy for anyone to get around and will end up punishing anyone on your website who has Javascript disabled or uses IE6 with SP2.

    -dk
     

Share This Page