hi again..
ok moved config.php to stats folder and edited my index.php to require_once("config.php");
It still refuses to accept my username/pass 3 times then gives me the "Authorization Required." page!
My config file :
><?php
/************************************************************************/
/* AWStats Access 2.0: Provides access to AWStats outside of cPanel */
/* ============================================ */
/* Created for and by members of TotalChoiceHosting.com */
/* Copyright (C) 2004 by TotalChoiceHosting.com */
/* */
/* This file is part of AWStats Access. */
/* AWStats Access is free software; you can redistribute it and/or */
/* modify it under the terms of the GNU General Public License as */
/* published by the Free Software Foundation; either version 2 of */
/* the License, or (at your option) any later version. */
/* */
/* AWStats Access is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with Foobar; if not, write to */
/* Free Software Foundation, Inc. */
/* 59 Temple Place, Suite 330 */
/* Boston, MA 02111-1307 USA */
/************************************************************************/
$username = "asdf"; /* used to access this utility */
$password = "asdf"; /* used to access this utility */
$site = "mysite.com";
$cpnlusername = "myCpanelUserName";
$cpnlpassword = "********";
?>
My index file
><?php
/************************************************************************/
/* AWStats Access 2.0: Provides access to AWStats outside of cPanel */
/* ============================================ */
/* Created for and by members of TotalChoiceHosting.com */
/* Copyright (C) 2004 by TotalChoiceHosting.com */
/* */
/* This file is part of AWStats Access. */
/* AWStats Access is free software; you can redistribute it and/or */
/* modify it under the terms of the GNU General Public License as */
/* published by the Free Software Foundation; either version 2 of */
/* the License, or (at your option) any later version. */
/* */
/* AWStats Access is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with Foobar; if not, write to */
/* Free Software Foundation, Inc. */
/* 59 Temple Place, Suite 330 */
/* Boston, MA 02111-1307 USA */
/************************************************************************/
require_once("config.php");
if (!isset($PHP_AUTH_USER)) {
header('WWW-Authenticate: Basic realm="Site Statistics"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
} else if (isset($PHP_AUTH_USER)) {
if (($PHP_AUTH_USER != $username) || ($PHP_AUTH_PW != $password)) {
header('WWW-Authenticate: Basic realm="Site Statistics"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
}
else {
if($QUERY_STRING == ""){$query = "config=$site";}else{$query=$QUERY_STRING;};
$Previous = false;
if(isset($_POST))
{
foreach($_POST as $key => $value)
{
if($Previous)
{
$POSTED .= "&";
}
$POSTED = "$key=$value";
$Previous = true;
}
}
$Curl = curl_init("http://$cpnlusername:$cpnlpassword@$site:2082/awstats.pl?$query");
if(isset($_POST))
{
curl_setopt($Curl, CURLOPT_POST, TRUE);
curl_setopt($Curl, CURLOPT_POSTFIELDS, $POSTED);
}
curl_setopt($Curl, CURLOPT_RETURNTRANSFER, 1);
$results = curl_exec($Curl);
for ($i = 0; $i < count($return_message_array); $i++) {
$results = $results.$return_message_array[$i];
}
if($query == "config=$site"){$results = str_replace("src=\"", "src=\"?", $results);}
if($framename==index){$results = str_replace("src=\"", "src=\"index.php?", $results);}
$results = str_replace("action=\"", "action=\"index.php?", $results);
$results = str_replace("href=\"", "href=\"?", $results);
$results = str_replace("href=\"?http://", "href=\"http://", $results);
$results = str_replace("awstats.pl?", "", $results);
echo $results;
}
}
?>
It Should work as i cant see anything wrong there