[UPHPU] challenge!

District Webmaster webmaster at alpine.k12.ut.us
Fri Apr 16 10:31:15 MDT 2004


You get the award for "thinking too seriously about a fun and simple
challenge" . . . but your statement is correct and I think very highly
of you. :)

The script I'm using already does what I need it to do -- and I know I
could have been more specific/exact about it, but I was just putting the
challenge out there for some list fun. I'm also aware that
spoofing/proxy/other issues could make the information incorrect.

Dave

ASD Webmaster
>>> Scott Barber <scott.barber at tonservices.com> 04/16/04 10:20 AM >>>
Umm... sorry to break your fun, but the subnet can't be determined from
the IP alone. You really have no idea what the subnet of the ip is. It
looks like you're just parsing for the 4th octet. That may or may not be
the real subnet.

:(

On Fri, 2004-04-16 at 10:15, District Webmaster wrote:
> Here's a quick and fun coding challenge for y'all: I want to determine
> the subnet of the machine that is visiting my web page.
> 
> I needed this for a script I'm running, and I could think of three  or
> four ways to do it - but I bet there's more. Show your creativeness
and
> mad mad php skills!!!!
> 
> Prizes will be awarded for:
> 
> The fastest (execution time)
> The shortest code
> The most convoluted or complicated
> The most backwards compatible
> The fastest to respond
> The most original
> The most anti-Wade :)
> 
> Prizes shall consist of me thinking very highly of you, at least
> momentarily.
> 
> Dave
> 
> P.S. ***SPOILER!!!!***
> Heres is my solution:
> 
> $subnet = implode (".", array_slice ( explode (".",
> $_SERVER["REMOTE_ADDR"]), 0, 3));
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: list-unsubscribe at uphpu.org
> For additional commands, e-mail: list-help at uphpu.org
-- 
Scott Barber
UNIX SysAdmin
TON Services, Inc.
801.624.4572
scott.barber at tonservices.com




---------------------------------------------------------------------
To unsubscribe, e-mail: list-unsubscribe at uphpu.org
For additional commands, e-mail: list-help at uphpu.org






More information about the UPHPU mailing list