+ Post New Thread
Results 1 to 6 of 6
Coding Thread, Need script to get IP and display relevant content in Coding and Web Development; Hello. Hope I am in the right forum! I know nothing about javascript but need a script that will: get ...
  1. #1
    dagza's Avatar
    Join Date
    Jul 2005
    Location
    Teesside
    Posts
    139
    Thank Post
    10
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Need script to get IP and display relevant content

    Hello. Hope I am in the right forum!

    I know nothing about javascript but need a script that will:

    get the computer IP address
    IF IPaddress="217.x.x.x" then {
    display an image}
    else {
    run a script I have
    }

    The problem is I have a nice animated slideshow on the VLE but it crashes when viewing over remote desktop.

    Anyone?

    Thanks

    Darren

  2. #2
    sahmeepee's Avatar
    Join Date
    Oct 2005
    Location
    Greater Manchester
    Posts
    795
    Thank Post
    20
    Thanked 70 Times in 42 Posts
    Rep Power
    33

    Re: Need script to get IP and display relevant content

    I'm not sure if you can do it client-side because javascript running in your browser doesn't have access to your IP address unless you set your security settings very low. I'd be a little wary of setting your browsers to trust the VLE because of all the user-uploaded content on there.

    You can do it from the server end if you have ASP/PHP etc. - what's the VLE and what kind of server is it running on?

  3. #3
    dagza's Avatar
    Join Date
    Jul 2005
    Location
    Teesside
    Posts
    139
    Thank Post
    10
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Need script to get IP and display relevant content

    Thanks for the response.

    That's a shame.

    It is MS Sharepoint and I suspect it is running on IIS. It hasn't got anything additional installed such as PHP.

  4. #4
    sahmeepee's Avatar
    Join Date
    Oct 2005
    Location
    Greater Manchester
    Posts
    795
    Thank Post
    20
    Thanked 70 Times in 42 Posts
    Rep Power
    33

    Re: Need script to get IP and display relevant content

    If it's on IIS, you could probably make an ASP page on that server containing something like:

    <%@Language="JScript"%>
    <%
    strIP = ServerVariables("REMOTE_ADDR");
    if (strIP == 'IP.OF.YOUR.TSERVER') {
    Response.Redirect("tserveralternative.html");
    }
    else {
    Response.Redirect("animatedslideshow.html");
    }
    %>

    Then make your link on Sharepoint point at that asp page.

    (code not tested, may contain nuts)

  5. #5
    dagza's Avatar
    Join Date
    Jul 2005
    Location
    Teesside
    Posts
    139
    Thank Post
    10
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Need script to get IP and display relevant content

    Great, thanks.

    I will look into this.

  6. #6

    FN-GM's Avatar
    Join Date
    Jun 2007
    Location
    UK
    Posts
    15,758
    Thank Post
    825
    Thanked 1,662 Times in 1,447 Posts
    Blog Entries
    11
    Rep Power
    441

    Re: Need script to get IP and display relevant content

    I have a VBS script when it is run it will display the computer name and IP address is that relivent?

    Z

SHARE:
+ Post New Thread

Similar Threads

  1. Replies: 2
    Last Post: 14th December 2007, 10:33 AM
  2. Script to display remaining disk quota
    By Ric_ in forum Scripts
    Replies: 18
    Last Post: 30th October 2007, 08:22 PM
  3. Replies: 7
    Last Post: 17th May 2007, 11:42 PM
  4. Can't find relevant online help for Moodle.
    By SimpleSi in forum Virtual Learning Platforms
    Replies: 19
    Last Post: 17th January 2007, 01:23 PM
  5. Replies: 6
    Last Post: 16th September 2006, 09:33 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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