Mobile app version of vmapp.org
Login or Join
Pierce454

: What I usually do (and if you're working with structured websites) is to include a php script to the beginning of your index page which you want to deny its access from user/bot. This include

@Pierce454

what I usually do (and if you're working with structured websites) is to include a php script to the beginning of your index page which you want to deny its access from user/bot.
This include verifies if the session 'auth' variable is set to 1. If not I redirect the user to the auth. page (it's just a form asking for a username and a password).

I create a .logs file that contains the username and the password (crypted thanks to the php method crypt('your password')).

The authentication script is verifying if the username and the password are successfully entered

if( crypt($_POST['password'], $password) === $password
&& $_POST['username'] === $username ){

$_SESSION['auth'] = 1;
header("Location: $_SERVER[HTTP_REFERER]");

}

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Pierce454

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme