Hi,
So far i have coded this authorization system to use on the forum software i am creating. But my server is down so i need some knowledgable eyes to look over it for me, Cheers
I also want to use a cookie to save their username, password and access_level, but i dont know how to code it, could someone show me how i can set the cookie.
The variables frmUsername and frmPassword are collected from a form.
--- auth.php ---
<?php
// Get The Username From The Form
$use_username = "$frmUsername";
// Get The Password From The Form
$use_password = "$frmPassword";
// Set The Path To The User Include Files
$lib_user_path = "/emcb/services/http/beta-php.emcb.co.uk/conf/users/includes";
// Set The Normal Working Directory
$lib_public_html = "/emcb/services/http/public_server/projects/exposureBB
// SUB - If User Include File Exists
if ($username.inc==true) {
// Set The Full Path To The Include File (/path/to/TheUsername.inc)
$user_data = "$lib_user_path" . "/" . "$username" . ".inc";
// Include The File In The PHP Application
require($user_data);
// Verify The Password With The Hassed Passwd In The Include File
$try_password = md5($use_password);
// Is The Password Is Correct
if ($try_password == "$password") {
// If The Password Is Correct
echo "Display Sucessfull Login Message";
}
// If The Password Is Incorrect
else {
echo "Display Login Failder Mesage";
}
}
// Else The Username Is Incorrect
else {
// The Username Is Unknown
echo "Display Invalid User Message";
}
}
?>
--- auth.php ---
Cheers Guys,
Elfyn