ciao a tutti ho il seguente problema: il mio host mi aveva fornito di uno script per far si che riuscissi ad accedere alla statistica (awstats) senza loggarmi (il link alla pagina era già in pagine nelle quali io avevo messo le restrizioni per vederle). lo script funzionava su server con installato cpanel.
Ora non so per quale motivo (economico credo) ha deciso di passare tutto su u altro server con installato ISP e loscript non funziona più. ovviamente l'host non ha intenzione di aiutarmi con lo script.
Mi aiutereste voi?
vi passo come era prima lo script:
<?php
//dv at josheli.com
$user = 'XXXXX';//your cpanel username
$pass = 'XXXXX';//your cpanel password
$domain = 'XXXXXXXXXX';//do not include 'http://' or 'www.'
/*
NO NEED TO TOUCH ANYTHING BELOW HERE
*/
//retrieves the file, either .pl or .png
function getFile($fileQuery){
global $user, $pass, $domain;
return file_get_contents("http://$user:$pass@$domain:2082/".$fileQuery);
}
//it's a .png file...
if(strpos($_SERVER['QUERY_STRING'],'.png')!==false) {
$fileQuery = $_SERVER['QUERY_STRING'];
}
//probably first time to access page...
elseif(empty($_SERVER['QUERY_STRING'])){
$fileQuery = "awstats.pl?config=$domain";
}
//otherwise, all other accesses
else {
$fileQuery = 'awstats.pl?'.$_SERVER['QUERY_STRING'];
}
//now get the file
$file = getFile($fileQuery);
//check again to see if it was a .png file
//if it's not, replace the links
if(strpos($_SERVER['QUERY_STRING'],'.png')===false) {
$file = str_replace('awstats.pl', basename($_SERVER['PHP_SELF']), $file);
$file = str_replace('="/images','="'.basename($_SERVER['PHP_SELF']).'?images',$file);
}
//if it is a png, output appropriate header
else {
header("Content-type: image/png");
}
//output the file
echo $file;
?>
GRAZIE