Now I have an Apache server that holds folders containing pictures and some home videos. I transferred the port and received it to show the folders when I enter my ip. My only problem is that any user can access it from all over the world. I found this PHP code on the Internet, so I can password protect these files:
<?php <h1>Login</h1> <form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <p><label for="txtUsername">Username:</label> <br /><input type="text" title="Enter your Username" name="txtUsername" /></p> <p><label for="txtpassword">Password:</label> <br /><input type="password" title="Enter your password" name="txtPassword" /></p> <p><input type="submit" name="Submit" value="Login" /></p> </form> <?php } else { ?> <p>This is the protected page. Your private content goes here.</p> <?php } ?>
I found a line where it says to post my personal content, but I donβt understand how to do it. im not trying to protect any html or php page trying to protect multiple folders. PS I can do it well, ftping on my server to access files, but I want to be able to also access them from any browser.
source share