Just out of curiosity, how would something like this work?
Username and Password are MD5 encrypted and stored in MySQL database.
An SSL cert on the site exsists.
Client visits a webpage, types username and password into a form..
<input type='text' name='username'>
<input type='password' name='password'>
anyway, when the form is submitted, php does a MD5 on it..
$U = MD5($username);
$P = MD5($password);
then does a mysql select to see if they match..
// Open_MySQL_Connection();
$Query = "SELECT username, password from USER_TABLE WHERE username = '".$U."' AND password = '".$P."' ";
$Result = MySQL_Query($Query) OR DIE('ERROR: '."<HR>".mysql_error()."<BR>".$Query."<BR><HR>");
// that little OR DIE part comes in handy when testing
// new and complicated queries
$RCount = MySQL_NUM_ROWS($Result);
if ($RCount <1) {
echo "ACCESS DENIED!";
// Close_MySQL_Connection();
exit();
} ELSE {
echo "ACCESS GRANTED!";
include ("../../my_file.php");
echo "click <a href='".$MY_HTTPS_URL."'><B> HERE </B></a> to enter pages..<P>";
// Close_MySQL_Connection();
}
the $MY_HTTPS_URL vaiable can be stored in a different file (my_file.php) that has the url stored in it.. not sure if that does any good or not, but it can't hurt...
// filename: my_file.php
$MY_HTTPS_URL = "https://www.my_secure_server.com";
function Open_MySQL_Connsction() {
// stuff here to connect to MySQL..
}
function Close_MySQL_Connsction() {
// stuff here to dis-connect from MySQL..
}
// #EOF #
Would something like that be conscidered secure?
just curious...
maybe it will be useful to somebody.. maybe not, but I hope so..
-Mystic