Help with scripts or software for closed sections of a website

frankfriend

Member
Messages
410
Reaction score
2
Points
18
Hi,
Can anyone share their experience of scripts, sources of scripts, or software to add a Members only section to a website. It must use secure passwords and user names, and log all entry attempts preferably with the IP address of the person trying to get into the site.
 

cybrax

Community Advocate
Community Support
Messages
764
Reaction score
27
Points
0
The htaccess file located in the root of your domain can provide username/ password access control to specific pages or entire folders though basic it is secure enough for most applications.

After that you move into the realms of encryption and databases where everything is scambled and even if somebody does manage to break in the information is unreadable.


Grabbing the visitors IP can be difficult sometimes, no one single method allways works so here is a complete IP reading script for PHP.

Code:
/ The function to get the visitor's IP.
function getUserIP()
{
    //check ip from share internet
    if (!empty($_SERVER['HTTP_CLIENT_IP']))
    {
      $ip=$_SERVER['HTTP_CLIENT_IP'];
    }
    //to check ip is pass from proxy
    elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
    {
      $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
    }
    else
    {
      $ip=$_SERVER['REMOTE_ADDR'];
    }
    return $ip;
}
 
//The users IP is...
$visitorsIp = getUserIP();
 
Top