greetings all!
Having another prob. When I try to log into a cpanel that I created, it will not let me log in. I dont know where to start, but here is the code:
<?php
$auth = false; // Assume user is not authenticated
if (isset( $PHP_AUTH_USER ) && isset($PHP_AUTH_PW)) {
// Connect to MySQL
mysql_connect('MySQL2.smarterlinux.com','computerzonehq','')
or die ( 'Unable to connect to server.' );
// Select database on MySQL server
mysql_select_db( 'computerzonehq' )
or die ( 'Unable to select database.' );
// Formulate the query
$sql = "SELECT * FROM users WHERE
username = '$PHP_AUTH_USER' AND
password = '$PHP_AUTH_PW'";
// Execute the query and put results in $result
$result = mysql_query( $sql )
or die ( 'Unable to execute query.' );
// Get number of rows in $result.
$num = mysql_num_rows( $result );
if ( $num != 0 ) {
// A matching row was found - the user is authenticated.
$auth = true;
}
}
if ( ! $auth ) {
header( 'HTTP/1.0 401 Unauthorized' );
header( 'WWW-Authenticate: Basic realm="Private"' );
echo 'You are not authorized to view this page!<BR>
Please <a href="login.php">Log In</a> to continute<BR>
<BR>
Thank you,<BR>
SysCom
';
exit;
} else {
//display authorized information
echo '
<P>You are logged in as, '.$PHP_AUTH_USER.'!</P>
<BR>
<a href="http://127.0.0.1/mysql/">Database Management</a>(Seperate Login Required.)<BR>
<a href="../counter/sc_stats.php">View Stats</a><BR>
<a href="../counter/sc_clear.php">Clear Server Stats</a>(Seperate Login Required.)<BR>
<a href="../phpinfo.php">View PHP Info</a><BR>
';
}
?>
Here is the login info
addy: www.computerzonehq.com/test/admin/index.php
User: dick
pass: tracey
It will not accept the password. It is in the table. I have even deleted and re-created the table twice. I dont know if it is not passing it or what?