Any ideas on how i can password protect a folder on a website without using .htaccess files.

Use a simple PHP script with a static username and password and maybe a javascript prompt form, or standard HTML prompt form.

<?php
$username = "myusername";
$password = "mypassword";

if (!isset($_POST['submit'])) {
?>
<form method="POST" action="<?=$_SERVER['PHP_SELF']?>">
Username: <input type="text" name="username"><br/>
Password: <input type="password" name="password"><br/>
<input type="submit" name="submit" value="Login">
<?php
} else {
      if ($_POST['username'] == $username && $_POST['password'] == $password) {
            echo "<a href="privatepage.html">Click to continue...</a>";
      }
}
?>

Or something like that. Not very secure though. But works.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.