[pmwiki-users] How to change page based on IP of visitor?

H. Fox haganfox at users.sourceforge.net
Wed Aug 29 18:23:02 CDT 2007


On 8/29/07, Steve Duncan <steve at swduncan.com> wrote:
> How would I set up Pmwiki to require a password depending on the IP address
> of the visitor?

I can hazard a guess...

The IP address is held in $_SERVER[REMOTE_ADDR'] so, in config.php

   if ($_SERVER[REMOTE_ADDR'] == '192.168.5.6') {
     $DefaultPasswords['foo'] = crypt('some_password');
   } else {
     $DefaultPasswords['foo'] = '@lock';
   }

Hagan



More information about the pmwiki-users mailing list