|
|
|
<?
if(!($PHP_AUTH_USER))
{
Header("WWW-authenticate: basic realm=\"restricted area\"");
Header( "HTTP/1.0 401 Unauthorized");
echo "failed\n";
?>
<meta http-equiv="refresh" content="0;url=failed.php3">
<?
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;
}
?>
<meta http-equiv="refresh" content="0;url=welcome.php3">
<?
}
?> |
|
| Logs hits to any page which includes it. Automatically utilises page access information left behind by PHP/FI2.0. Categories : Databases, PHP, mSQL, Databases | | | Returns the last row from a select where multiple rows have been selected.
In this case it is used to determine the last number in an AUTO_INCREMENT column. I use it to create "ticket numbers" or anything that needs a unique ID in sequence. Categories : mSQL, MySQL, Databases, PHP | | | Authorize Me! An authentication script. Categories : MySQL, Databases, Authentication, PHP | | | Is there some possibility to link a database to an htaccess file, so that instead of having a passwd file you would have a database with DES-crypted password and username fields? Categories : Authentication, PHP, General SQL, Databases | | | Full membership authentication system. Categories : Authentication, MySQL, PHP, Databases | | | Implementing a "Members ONLY" area Categories : PHP, MySQL, Databases, Authentication | | | AUTH (.htaccess style) - a login system that uses PostgreSQL. Categories : PHP, Authentication, Databases, PostgreSQL | | | complete, simple, working example of a login screen/system using php functions, cookies, and a mysql database for begginers. Categories : Authentication, Complete Programs, PHP, MySQL, Databases | | | Initializing the MSQL-tables via a 2-dimens array Categories : mSQL, PHP, Databases | | | This program allows you to upload an ODBC ressource - i.e. an MS-Access database to a MySQL server. Categories : Databases, MySQL, Complete Programs, PHP, Databases | | | An SQL Administration User Interface for the Web Categories : Databases, PHP, mSQL, Complete Programs | | | PHP4 AND MySQL Authentication Categories : PHP, MySQL, Authentication, Databases | | | msql -- Send mSQL query Categories : PHP, PHP Functions, mSQL, mSQL | | | databases administration remote Web Categories : mSQL, PHP, Complete Programs, Databases | | | This is Yet Another Sql Abstraction Library. Include it in your script and you can use the most important SQL functions without worrying about the SQL backend. Categories : Databases, PHP, ODBC, MySQL, PostgreSQL | |
| | | | Richard Clark wrote :146
I,m new to PHP3 Development. I,m trying to build a auth
script. The idea is to use basic checking script where
php3 checks mysql username and password fields, once
verified, the script using the <a> link finds the field with
the url for the page I want that company to access i.e
so if user - mike logs in he enters his username &
password the script checks for verifaction call up the url
mikespage.html and lets him link to his personal stuff...
all this info being in mysql
| |
|
|
|