Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: IP redirect


Message #1 by "Jeri Traw" <jeritraw@h...> on Tue, 11 Feb 2003 16:25:16
Hi, Jery !

If you can use server-side tecnology then use ASP to achieve this:

<%
'it's t someone from inside the campus
if request.servervariables("remote_addr") =3D "168.0.0.1"  then
	response.redirect ("on_campus_version.asp")
else
'it's not someone from inside the campus
	response.redirect ("off_campus_version.asp")
end if
%>

Just save this page as "index.asp" and you're ready to go !!!

HTH

PauloF

-----Original Message-----
From: Jeri Traw [mailto:jeritraw@h...]
Sent: ter=E7a-feira, 11 de Fevereiro de 2003 16:25
To: JavaScript HowTo
Subject: [javascript_howto] IP redirect

I am an academic library web coordinator and am just getting into
scripting. Can anyone help me figure out hoe to redirect my users, based

on there IP address, to a particular page. Whenever anyone form
off-campus
clicks on the link to my library's periodical indexes page, I want to
immediately redirect them to an "off-campus version" of that page. Can I

do this with JavaScript? I need something that will work with any
browser,
and that is simple for me to use.

Any suggestions?

Thnaks.



  Return to Index