[PHP-DB] Re: set password on a page

2003-09-21 Thread Gabriel Peugnet
Use setCookie()  function. It places a global variable on the client that
your programs can verify after. See the manual for the use of the function.
Here is an example:

// Example of file chkacces.php.
?php

$pass = $_POST['password'];// It receives the password from a FORM
with POST method.

if( ($pass != xyz ){// where xyz is the right password.
echo You are not autorized to see this page;
return;
}

// Autorized.
setCookie( $USER, autorized );

header( Location: index.php );// redirects to index.php

?

Example for your index.php file:

?php

if( ($USER != autorized ){
echo You are not autorized to see this page;
return;
}

// Here goes the code for autorized users.

?

The variable set with setCookie() is not availabe until the script ends. See
details in the manual.
The manual is available in www.php.org

Sagerat [EMAIL PROTECTED] escribió en el mensaje
news:[EMAIL PROTECTED]
 How do I set up password on a page so that only restricted people can open
 it?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Re: set password on a page

2003-09-21 Thread Gabriel Peugnet
In my last replay I told you to find the manual in the wrong place.

The right place is www.php.net


Sagerat [EMAIL PROTECTED] escribió en el mensaje
news:[EMAIL PROTECTED]
 How do I set up password on a page so that only restricted people can open
 it?

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php