• Login
  • Stats
  • Tools
  • Whois
  • Email Whois
  • Fingerprint
  • Logout
  • Contact
  • Lost Password
WebTracker.one
 
Login
Site Stats
Tools
Whois
Email Whois
Fingerprint
Logout
Contact
Lost Password
Please enable JavaScript to view this site.

Login Protection

You already have a username and password for login.php or php-enabled login.html. What else can you do? You can limit the login script to your IP address. Anyone logging in from an IP address other than yours will get a dead page. Simply add this line of code to your PHP script:

if($_SERVER['REMOTE_ADDR'] != '11.11.111.111'):
die;
endif;

Just replace 11.11.111.111 with your own IP address.

BTW, make sure you are fully screening any usernames and passwords put into your forms. Here is an example:

// Set session variables
$username = $_SESSION['username'] ?? ''
$password = $_SESSION['password'] ?? '';
#declare post variables for the session
$username = $_POST['username'] ?? '';
$password = $_POST['password'] ?? '';
#remove dangerous or unnecessary characters
$username = stripslashes($username);
$passwords = stripslashes($password);
$username = strip_tags($username);
$passwords = strip_tags($passwords);
$username = preg_replace('#[;:]#','',$username);
$password = preg_replace('#[;:]#','',$password);
$username = (htmlentities($username));
$password = (htmlentities($password));
$username = trim($username);
$password = trim($password);

     * posted by Robert on Sun, Jul 03, 2022


Return to Weblog Home



Site built and hosted by RJdesign.one