Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage
Php > Authentication sample source codes
User-authentication with php3 and msql
User-authentication with php3 and msql if(!($PHP_AUTH_USER)) { Header("WWW-authenticate: basic realm=\"restricted area\""); Header( "HTTP/1.0 401 Unauthorized"); echo "failed\n"; ?>
exit; } else { msql_connect("localhost"); $user_id=strtolower($PHP_AUTH_USER); $password=$PHP_AUTH_PW; $Selstr="select * from user where user='$user_id' and password='$password'"; $Result=msql("test",$Selstr); if(!msql_num_rows($Result)) { Header( "WWW-authenticate: basic realm=\"restricted area\""); Header( "HTTP/1.0 401 Unauthorized"); exit; } ?>
} ?>
Privacy Policy
|
Link to Us
|
Links