Hi there
I have a mysql db online which sits behind an ssl socket(with certificate) on a Plesk server with Apache 2 running.
When I go to secure area eg https.secure.platipus.../index.swf
I have to enter passwords and usernames (authentication screen) currently set on the system to login to run flash movie.
1.'What I want to do is basically grab the username and password info entered (authentication screen) and place it into mysql database so that I can log who is using the software' within ssl area
Is there any way of grabbing this information from the authentication screen via php code that comes up I am sure there must be
Apparently the user info is stored in Apache --AuthDBMUserFile--I cannot find the file and don't know how to reference it.I don't have permission for apache config file.
this php file already sits inside secure area !
Here is the code that I have so far for basic screen login
<?php
$auth=false; //assume user is not authenticated
/////////this brings up password screen
if (!isset($SERVER['PHP_AUTH_USER']) && (!isset($SERVER['PHP_AUTH_PW']))) {
header('WWW-Authenticate: Basic realm="My Private Stuff"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required now fool.';
} else {
//setup connect info
$DBhost = "localhost";
$DBuser = "adminss";
$DBpass = "dogs";
$DBName = "logging";
$table = "testlog";
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to database");
///////////compare username and password with that of db
@mysql_select_db("$DBName") or die("Unable to select database $DBName");
//compare with username and password
$sqlquery = "SELECT * FROM $table WHERE username='$PHP_AUTH_USER' AND password='$PHP_AUTH_PW'";
$result = mysql_query($sqlquery);
//get number of rows
$number = mysql_numrows($result);
if ($number!=0){
$auth=true;
echo 'successful connection';
}
}
if(!$auth){
header('WWW-Authenticate: Basic realm="Private"');
header('HTTPS/1.0 401 Unauthorized');
echo 'authorization required';
}else{
}
?>
what happens with the above code is that my password (authentication) screen gets overridden(doesn't show) by the login screen of the ssl connection with different password.I can link to db for selecting table info no problem.My user and password screen is just not showing help..
2.How and what do I need to configure in my php code for going through an SSL connection and authenticate??
sorry lots of questions hope not too confusing
rooky