By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,226 Members | 1,381 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,226 IT Pros & Developers. It's quick & easy.

IP restricted site

P: n/a
I would like to have a home page the will display
a stop light with a red or green light if you are viewing the page from
the allowed network ( green light )
not on the allowed network
( red light )
I will do the lock down in apache.

Is there any examples on how this could be done ( sample code)
( I will work on the stop light image ) I just need the html logic.
has to work on IE 6 and netscape 6.0 <
any examples or places to look would be great.


Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"xman" <im*****@bsd.uchicago.edu> wrote:
I would like to have a home page the will display
a stop light with a red or green light if you are viewing the page from
the allowed network ( green light )
not on the allowed network
( red light )
I will do the lock down in apache.

Is there any examples on how this could be done ( sample code)
( I will work on the stop light image ) I just need the html logic.
has to work on IE 6 and netscape 6.0 <
any examples or places to look would be great.


This is more of a CGI question than an HMTL one. The answer will
depend on what server-side programming language you're using, but it
involves reading the REMOTE_ADDR value sent with the request in the
HTTP headers.

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 20 '05 #2

P: n/a
Harlan Messinger wrote:
"xman" <im*****@bsd.uchicago.edu> wrote:
I would like to have a home page the will display
a stop light with a red or green light if you are viewing the page from
the allowed network ( green light )
not on the allowed network
( red light )
I will do the lock down in apache.

Is there any examples on how this could be done ( sample code)
( I will work on the stop light image ) I just need the html logic.
<sig-bait>There's no logic in HTML.</sig-bait>

Seriously, HTML doesn't _do_ stuff, there aren't conditionals. It just
describes data.

has to work on IE 6 and netscape 6.0 <
any examples or places to look would be great.


This is more of a CGI question than an HMTL one. The answer will
depend on what server-side programming language you're using, but it
involves reading the REMOTE_ADDR value sent with the request in the
HTTP headers.


He said he's using Apache to turn people away; there's no need for a script
to be checking the IP address. Just use Apache's error handler.

<URL:http://httpd.apache.org/docs-2.0/mod/core.html#errordocument>

Basically, just plonk down a file at /errors/401.html and put the following
in .htaccess:

ErrorDocument 401 /errors/401.html

Obviously, you have to allow everyone to access the error document.
--
Jim Dabell

Jul 20 '05 #3

P: n/a
I only have part of the site restricted
I kind of wanted to make it look nice so that
if management was off site and hit the page they could see that the
downloads would not work
.... or anyone else.
then if they click on the link it can give them the error code. The green
light ... all is good the links work.
I guess I will look into perl for this
thanks.

"Jim Dabell" <ji********@jimdabell.com> wrote in message
news:Kv********************@giganews.com...
Harlan Messinger wrote:
"xman" <im*****@bsd.uchicago.edu> wrote:
I would like to have a home page the will display
a stop light with a red or green light if you are viewing the page from
the allowed network ( green light )
not on the allowed network
( red light )
I will do the lock down in apache.

Is there any examples on how this could be done ( sample code)
( I will work on the stop light image ) I just need the html logic.
<sig-bait>There's no logic in HTML.</sig-bait>

Seriously, HTML doesn't _do_ stuff, there aren't conditionals. It just
describes data.

has to work on IE 6 and netscape 6.0 <
any examples or places to look would be great.
This is more of a CGI question than an HMTL one. The answer will
depend on what server-side programming language you're using, but it
involves reading the REMOTE_ADDR value sent with the request in the
HTTP headers.


He said he's using Apache to turn people away; there's no need for a

script to be checking the IP address. Just use Apache's error handler.

<URL:http://httpd.apache.org/docs-2.0/mod/core.html#errordocument>

Basically, just plonk down a file at /errors/401.html and put the following in .htaccess:

ErrorDocument 401 /errors/401.html

Obviously, you have to allow everyone to access the error document.
--
Jim Dabell

Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.