How do i create password protected web page???

^Mike^

Fully Optimized
Messages
2,958
I'm finishing up a website i created for a local organization (i'm not getting paid) and the last thing i need to do is make a "members only" page with a login and all the members would have the same username and password and they would just need to type it in the login and they are taken to the members only page. Anyone know how i could create this? Or are there any message programs or something that would work?

don't think to hard guys because i may have found something that would work but i still need some input
 
You could either use a .htaccess file (Google for a tutorial), or a MySQL database with the usernames and passwords.

That way, you could allow people to register their own usernames and passwords, instead of everybody sharing the same login credentials.
 
.htaccess is only an option if the site is hosted on an Apache server. Is the site being hosted with Apache or IIS?
 
if it supports php.....

Code:
<?php

$MyPassword = 'password';
if (isset($_POST['Submit']) && $_POST['Password']==$MyPassword)
     {
          // show page
} else {
echo 'invalid password';
}
?>
<form action="<?php $PHP_SELF; ?>" method="post">
password:
<input type="text" name="Password">
<br>
<input type="submit" name="Submit" value="Submit">
</form>
 
Back
Top Bottom