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
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?
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.
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)
Re: Need script to get IP and display relevant content
Great, thanks.
I will look into this.
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