i want to password protect, i may have a page or pages that i don't want anyone view page, such as an administrative page.
password protect
A simple way to so is by making a form which looks like a login page with username & password Textfields.<form method=post action=login.php>
Then in the login.php page, write the following code:
<?php
if ($username == 'USERNAME' && $password == 'PASSWORD'){
header ("Location:admin.php");
}else{
header ("Location:wrongpassword.php");
}
?>
Just make sure your admin pages make a similar validity check... otherwise a user could simply enter the admin URL and vector right there.
Dave
===========================================
http://badblue.com/helpphp.htm
Free small footprint web server for Windows
PHP, P2P file-sharing, transcoding and more
[deleted]
Put the admin pages into a sub directory and use the standard authentication of your webserver to protect them.
If you are using Apache, check out .htaccess files. For IIS I think there is some sort of NT User Auth which works similar to .htaccess.
I would go the .htaccess route.
Check thidspage out for some help.
http://faq.clever.net/htaccess.htm
Another thing I would do if I were you is create a uncommon directory naming convention for your admin section.
Bad = http://www.domain.com/admin/
good= http://www.domain.com/.ADMIN_area/
or somthing to that effect...
Paul