Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #2512

Re: Restricting access to a website

From Chuck Anderson <cycletourist@invalid.invalid>
Newsgroups comp.lang.php
Subject Re: Restricting access to a website
Date 2011-07-12 10:33 -0600
Organization cycletourist.com
Message-ID <ivht1f$5pu$1@dont-email.me> (permalink)
References (1 earlier) <ivdmns$qg$1@dont-email.me> <fvlm17528gbqkv7ff3mjrhd94dd4hflrso@4ax.com> <ivfpv7$hvj$1@dont-email.me> <5qtm17hecn89sdv8rdn71rnmv9osv3nrmb@4ax.com> <3bmo17h4sr9qa7du3nk9eucadcghlrjjke@mfesser.de>

Show all headers | View raw


Michael Fesser wrote:
> .oO(Graham Hobbs)
>
>   
>> On Mon, 11 Jul 2011 17:29:08 -0400, Jerry Stuckle
>>     
>>> You definitely need alt.apache.configuration.  No need to do anything to 
>>> your php code.
>>>       
>> OK, thanks.
>>     
>
> Or search the Web for tutorials. The keyword to look for is "HTTP Basic
> Authentication".
>
> Micha
>   


This will still require user input (a password), and the the OP said ...


> .... I envision hard coding their home
> address's into my index.php?? Am not interested in any additional
> typing by these three. 


So it would seem that the simplest solution that fits this bill is:

if ($_SERVER['REMOTE_ADDR'] != $ipaddr1 AND
$_SERVER['REMOTE_ADDR'] != $ipaddr2)
{
echo 'Sorry, not yet available';
exit;
}

-- 
*****************************
 Chuck Anderson • Boulder, CO
  http://cycletourist.com
 Turn Off, Tune Out, Drop In
*****************************

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Restricting access to a website Graham Hobbs <ghobbs@cdpwise.net> - 2011-07-10 22:01 -0400
  Re: Restricting access to a website Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-10 22:21 -0400
    Re: Restricting access to a website richard <member@newsguy.com> - 2011-07-10 22:49 -0400
      Re: Restricting access to a website Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-11 06:38 -0400
    Re: Restricting access to a website Graham Hobbs <ghobbs@cdpwise.net> - 2011-07-11 16:08 -0400
      Re: Restricting access to a website Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-11 17:29 -0400
        Re: Restricting access to a website Graham Hobbs <ghobbs@cdpwise.net> - 2011-07-11 18:21 -0400
          Re: Restricting access to a website Michael Fesser <netizen@gmx.de> - 2011-07-12 16:27 +0200
            Re: Restricting access to a website Graham Hobbs <ghobbs@cdpwise.net> - 2011-07-12 11:23 -0400
            Re: Restricting access to a website Chuck Anderson <cycletourist@invalid.invalid> - 2011-07-12 10:33 -0600
              Re: Restricting access to a website Graham Hobbs <ghobbs@cdpwise.net> - 2011-07-12 13:04 -0400
              Re: Restricting access to a website Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-12 15:13 -0400
                Re: Restricting access to a website Chuck Anderson <cycletourist@invalid.invalid> - 2011-07-12 15:19 -0600
                Re: Restricting access to a website Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-12 19:35 -0400
        Re: Restricting access to a website Chuck Anderson <cycletourist@invalid.invalid> - 2011-07-11 17:24 -0600
          Re: Restricting access to a website Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-11 20:38 -0400
            Re: Restricting access to a website Luuk <Luuk@invalid.lan> - 2011-07-13 21:13 +0200
              Re: Restricting access to a website The Natural Philosopher <tnp@invalid.invalid> - 2011-07-13 20:43 +0100
                Re: Restricting access to a website Luuk <Luuk@invalid.lan> - 2011-07-13 21:53 +0200
                Re: Restricting access to a website The Natural Philosopher <tnp@invalid.invalid> - 2011-07-14 00:17 +0100
                Re: Restricting access to a website Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-14 00:12 -0400
                Re: Restricting access to a website Michael Fesser <netizen@gmx.de> - 2011-07-13 21:56 +0200
                Re: Restricting access to a website The Natural Philosopher <tnp@invalid.invalid> - 2011-07-14 00:53 +0100
              Re: Restricting access to a website Michael Fesser <netizen@gmx.de> - 2011-07-13 21:49 +0200
                Re: Restricting access to a website Luuk <Luuk@invalid.lan> - 2011-07-13 22:12 +0200
                Re: Restricting access to a website Michael Fesser <netizen@gmx.de> - 2011-07-14 00:13 +0200
                Re: Restricting access to a website The Natural Philosopher <tnp@invalid.invalid> - 2011-07-14 00:54 +0100
                Re: Restricting access to a website Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-14 00:14 -0400
              Re: Restricting access to a website Jerry Stuckle <jstucklex@attglobal.net> - 2011-07-14 00:09 -0400
      Re: Restricting access to a website The Natural Philosopher <tnp@invalid.invalid> - 2011-07-12 00:43 +0100
      Re: Restricting access to a website Graham Hobbs <ghobbs@cdpwise.net> - 2011-07-13 14:44 -0400
        Re: Restricting access to a website Graham Hobbs <ghobbs@cdpwise.net> - 2011-07-13 21:05 -0400
  Re: Restricting access to a website The Natural Philosopher <tnp@invalid.invalid> - 2011-07-11 08:17 +0100
  Re: Restricting access to a website Man-wai Chang <toylet.toylet@gmail.com> - 2011-07-13 00:32 +0800
  Re: Restricting access to a website Man-wai Chang <toylet.toylet@gmail.com> - 2011-07-13 00:34 +0800
  Re: Restricting access to a website Bill B <me@privacy.net> - 2011-07-14 08:55 -0400

csiph-web