Re: Authorization & multiple 'docs'
| From: | Chris Lee | Date: | Wed, 06 Dec 2000 21:06:12 +0000 |
| Subject: | Re: Authorization & multiple 'docs' | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-28987@lists.php.net to get a copy of this message | ||
Youve almost answered your own question here :) If you have code that
checks wether a username and passwd are correct and it works on one page,
and you wan to know how to make it work on all the pages, well copy that
code to all those pages :) make sense ? if your using
$PHP_AUTH_USER
$PHP_AUTH_PW
those variables will be automatically carried to all the pages, just
check if their correct. I do this method, it works great, I wouldnt
refresh to another page though, no need. If the user enters a valid
passwd then let him see the current page, else print
echo "Hey dumbass get it together";
exit();
It works for me
Chris Lee
Mediawaveonline.com
In article <00120621353901.00991@bobe>, "Robert Ludvik"
<robert.ludvik@zd-lj.si> wrote:
> hi i have Apache with PHP4 and PostgreSQL installed. i'm writing a
> simple internet app. and i have some basic Qs. i have users listed in
> SQL base with names and passwds. i've made an PHP page, which checks if
> correct names and passwds are writen in a form. if the name and passwd
> are OK, it calls up the second php page. problem is, that any user could
> access that second page without authorization, simply with directly
> typing in it's name! How can i avoid that? how can i restrict access to
> that other page from pages different that previous (if it can be done?)?
> grateful for any help thnx Robert
>
>