E
Eef
I tried the script suggested by Chris Leeds (see below)
The form appears all right, but then I get the message :"Can't find webpage"
What should be written where at the end it says: "This is the protected
page. Your private content goes here"?
(My host does support FP-Server extensions, but NOT at the same time the
protecting a subsite or page.)
EARLIER TEXT
if you only need one user name and password here's a nice simple script
example:
http://www.totallyphp.co.uk/scripts/password_protect_a_page.htm
if you need the users to all have a UN/PW then you're getting into a
situation where you'll need a database, sign-up system, password retrieval
system, etc.
HTH
--
Chris Leeds
CODE
<?php// Define your username and password$username = "someuser";$password =
"somepassword";if ($_POST['txtUsername'] != $username ||
$_POST['txtPassword'] != $password) {?><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}?>
Eef
The form appears all right, but then I get the message :"Can't find webpage"
What should be written where at the end it says: "This is the protected
page. Your private content goes here"?
(My host does support FP-Server extensions, but NOT at the same time the
protecting a subsite or page.)
EARLIER TEXT
if you only need one user name and password here's a nice simple script
example:
http://www.totallyphp.co.uk/scripts/password_protect_a_page.htm
if you need the users to all have a UN/PW then you're getting into a
situation where you'll need a database, sign-up system, password retrieval
system, etc.
HTH
--
Chris Leeds
CODE
<?php// Define your username and password$username = "someuser";$password =
"somepassword";if ($_POST['txtUsername'] != $username ||
$_POST['txtPassword'] != $password) {?><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}?>
Eef