Hi there
I am simply trying to insert the username('PHP_AUTH_USER') and password('PHP_AUTH_PW') from a HTTPS authentication screen into mysql table
This does not work anymore system uses php4.4.1 with Apache 2
Could someone please help!!
heres the code:-
<?php
$auth=false;
$DBhost = "localhost";
$DBuser = "xxuser";
$DBpass = "xx";
$DBName = "xx";
$table = "xx";
$PHP_AUTH_USER = $SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$SERVER['PHP_AUTH_PW'];
//flash form variables that insert okay into database
$namelog = $POST['projectname2'];
$ownerlog = $POST['projectlocation2'];
$applic = $_POST['application3'];
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable toconnect to database");
@mysql_select_db("$DBName") or die("Unable to select database $DBName");
$sqlquery = "INSERT INTO $table (projectname,location,application,username,password,date) VALUES ('$namelog','$ownerlog','$applic','$PHP_AUTH_USER',PASSWORD('$PHP_AUTH_PW'),NOW())";
$result = mysql_query($sqlquery);
//get number of rows
$number = mysql_num_rows($result);
$i = 0;
if ($number < 1) {
}
else {
while ($number > $i) {
$thename = mysql_result($result,$i,"name");
$theemail = mysql_result($result,$i,"owner");
$i++;
}
}
?>
query inserts flash form variables fine but not the username and password
I know the password will be encrypted thats fine as long as I get the username aswell
thanks
Chris