WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : external authentication
Categories : Authentication, PHP Update Picture
Rasmus Lerdorf
Date : Oct 10th 1998
Grade : 2 of 5 (graded 3 times)
Viewed : 20994
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Rasmus Lerdorf
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

> In order to prevent someone from writing a script which reveals the
> password for a page that was authenticated through a traditional external
> mechanism, the PHP_AUTH variables will not be set if external authentication
> is enabled for that particular page.
> Does that mean that the database and the web server have to be on the
> same machine?

I realize you figured out your problem, but just to clarify what is meant
by "external authentication" in the documentation. As far as PHP is
concerned, any authentication not performed by PHP is external. So, if
you have mod_auth_mysql doing the authentication, for example, then you
will not have the $HTTP_AUTH_* variables set. You will have the
traditional $REMOTE_USER variable, of course, so you know who the logged
in user is, but you will not know the password. Since the password has
already been checked there is no reason for you to know it.


> My understanding of authentication it that REMOTE_USER is set whatever form
> of http authentication you use, whether it be mod_auth, mod_auth_mysql, or
> PHP (or any others there are). But PHP_AUTH_USER is only set if you are
> using PHP's http authentication hooks and even if you are using PHP's
> authentication hooks its safer to get REMOTE_USER from the environment.


Actually, took another look at the Apache-1.3 code. This is correct. If
PHP does the authentication $REMOTE_USER will be set, so my last post was
inaccurate. Still, if authentication is done outside PHP, PHP_AUTH_USER
will not be set.



Complete, simple working example of login screen and check on a unique page using php functions, cookies and mysql database.
Categories : PHP, Cookies, MySQL, HTML and PHP, Authentication
Password protection for Phorum 3.1.x with userlevels and log.
Categories : PHP, MySQL, Authentication, Security
Basic Authentication with sessions
Categories : PHP, Beginner Guides, Authentication, Form Processing, Sessions
Simple and fast user authentication
Categories : PHP, PHP Classes, Authentication
Basic WWW-Authentication example
Categories : PHP, Authentication
AUTH (.htaccess style) - a login system that uses PostgreSQL.
Categories : PHP, Authentication, Databases, PostgreSQL
Form Security - Match A Value For Success
Categories : PHP, Authentication, HTML and PHP, Sessions, Security
PHP4 AND MySQL Authentication
Categories : PHP, MySQL, Authentication, Databases
Using $PHP_AUTH_USER and $PHP_AUTH_PW to authenticate.
Categories : Authentication, PHP
Function to remember password
Categories : PHP, Authentication, Personalization and Membership
what salt do I have to feed the crypt function with to make it work like the htpasswd command of apache?
Categories : Algorithms, PHP, Authentication
Validation function for LUHNMod10 and variant. Can discriminate credit card numbers of varying lengths. Uses [Double >> Sum-of-Digits] transform.
Categories : Credit Cards, Authentication, Ecommerce, PHP
Full membership authentication system.
Categories : Authentication, MySQL, PHP, Databases
PHP4 MYSQL Authentication Script with cookie. Short & Sweet
Categories : Authentication, Apache, Cookies, PHP, MySQL
Using Postgres and PHP3 Authentication from a Web application
Categories : PostgreSQL, HTML and PHP, Authentication, PHP
 Dan Roscigno wrote :118
I am having a problem with php auth not setting the
$REMOTE_USER.  If
I use mod_mysql_auth the $REMOTE_USER gets set, but when I
use php auth the logfiles show a `-` for the user.  I am
running php 3.0.12 and Apache 1.3.9