Well, I have a Page and want to protect it, But with htaccess, everything in the directory is closed. I just want to ask for a Password and User Name to enter it, not the other things in the directory.
Here is the code I've already gotten in it:
<?php
$pagina = "content.html";
if(isset($_POST)){
if($_POST["conteudo"]){
$fopen = fopen($pagina,"w+");
fwrite($fopen,$_POST["conteudo"]);
fclose($fopen);
}
}
?>
<head>
<title>Edit Content Modal</title>
</head>
<br>
<br><br><br>
<form method="post">
<textarea name="conteudo" style="height: 400px; width: 800px; border: none; margin-left: 27%;" placeholder="Type Here the Code..."><?= file_get_contents($pagina); ?></textarea>
<br><br><input style="margin-left: 50%;" type="submit" value="Save Changes"/>
</form>
I want to put only one Password on this page (It will serve to edit another). But only in it, not in the entire directory. I believe that the password needs to be stored in a PHP file so no one will discover it.
Thank you.