473,407 Members | 2,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

IP restricted site

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
3 2136
"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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

30
by: Sean R. Lynch | last post by:
I've been playing around with Zope's RestrictedPython, and I think I'm on the way to making the modifications necessary to create a capabilities-based restricted execution system. The idea is to...
13
by: Rolf Magnus | last post by:
Hi, I would like to embed a python interpreter within a program, but since that program would be able to automatically download scripts from the internet, I'd like to run those in a restricted...
0
by: rico | last post by:
I recently downloaded several "updates" from Windows Update and now my CodeReport generated HTML documentation does not work as it did before. CodeReport for Microsoft Visual Studio .NET 2003....
0
by: Carlo Marchesoni | last post by:
If you Build Comment Web pages this results in restricted sites and you are not able to navigate thru them. Is there a way to change this to be 'trusted' ? Thanks for any help
0
by: Wojciech Pawlikowski | last post by:
Hey, I work on some project where main part (core) is coded in C (for speed) and the rest is in Python. Python API is used to launch python modules without using any exec() system() calls (thread...
0
by: Magnus Blomberg | last post by:
Hi! I am trying to write a simple public web application (internet) where the root is public (anonymous) and where I have a subfolder called admin where a few aspx-pages should be restricted to...
21
by: iapain | last post by:
I'm developing a webIDE for python and I've 2 questions regarding it. 1. How can i disable some of the modules without deleting. e.g I wish to disable "os" module. 2. How can i force user code...
3
by: Paul Rudin | last post by:
I'm occasionally seeing tracebacks like this: Traceback (most recent call last): File "logging/__init__.py", line 744, in emit File "logging/__init__.py", line 630, in format File...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.