There are pages on the server, available at http://mysite.ru/admin.php. But I want this page to be opened only from my computer. Is it possible to make it so that if there is a file in C: /dostup.txt, this page (admin.php) comes off, and if the file dostup.txt is not in the "C" file of the dostup.txt file, the admin.php file doesn't work?

Has anyone done this? What to read? Tell me, I will be glad to any help.

    4 answers 4

    You can make it so that the login is carried out only when you upload the correct file (the presence of the correct cookie, set manually or something else). And to read something from the user's disk without his consent (file upload) will not work.

      If you have a static ip address - just check the IP, if the IP is not yours do 404, everything ingenious is simple, but if not, then there is no way :)

        Configure user authentication on the server. create .htpasswd with a login password, and .htaccess in which write the full path to the file with a password. And a script in the general case will not receive access to a file on a local disk for security reasons.

          Not! The php script runs on the server and can only open files from the server. Alternatively, you can manually transfer the file, encrypted, and then the script to write a decryption algorithm. SSL is even easier. Or bind to IP.