|
|||||||
![]() |
|
|
LinkBack | Strumenti discussione | Cerca in questa discussione | Modalità visualizzazione |
|
|||
|
Questo script permette di accedere alla visualizzazione delle statistiche prodotte da webalizer senza accedere a cPanel dopo averlo adeguatamente configurato inserendo username, password e nome del dominio.
Codice:
<?php
//dv at josheli.com
$user = 'username';
$pass = 'password';
$url = 'www.mydomain.com';//do not include 'http://'
//retrieves the webalizer file, either .html or .png
function getFile($file){
global $user, $pass, $url;
return file_get_contents("http://$user:$pass@$url:2082/tmp/$user/webalizer/$file");
}
//alters links, either .html or .png
function changeLinks($subject, $type) {
return preg_replace("/($type=\")(?!http)(.*?)\"/is","$1$PHP_SELF?$2\"",$subject);
}
if(!empty($_SERVER['QUERY_STRING'])){
//get file (whether png or html)
$page = getFile($_SERVER['QUERY_STRING']);
//if png, output appropriate header
if(strpos($_SERVER['QUERY_STRING'],'.png')!==false){
header("Content-type: image/png");
}
//change the .png src(s)
else {
$page = changeLinks($page, 'src');
}
}
else {
//get index
$page = getFile('index.html');
//change links
$page = changeLinks($page, 'href');
//change the usage.png src
$page = changeLinks($page, 'src');
}
//output it
echo $page;
?>
|
|
|||
|
Salve,
il sitema da voi segnalato mi era utilissimo ma ora mi d? il seguente errore Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /home/fossilic/public_html/visit.php on line 11 Warning: file_get_contents(http://...@www.sito.com:2082/tmp/fos...zer/index.html): failed to open stream: Permission denied in /home/fossilic/public_html/visit.php on line 11 qualcuno saprebbe dirmi il perch |
![]() |
| Strumenti discussione | Cerca in questa discussione |
| Modalità visualizzazione | |
|
|
Discussioni simili
|
||||
| Discussione | Autore discussione | Forum | Risposte | Ultimo messaggio |
| webmail senza cpanel | domsaggese | Pannello di controllo Cpanel - Linux | 3 | 12-11-2007 10.08.31 |
| Accedere a cPanel/WHM/webmail dalla porta 80 | serverplan | Pannello di controllo Cpanel - Linux | 4 | 27-04-2007 08.55.59 |
| Visualizzare AWStats senza accedere in Cpanel | serverplan | Pannello di controllo Cpanel - Linux | 4 | 27-01-2007 17.38.38 |
| non visualizzare temporaneamente un sito | frhell | HTML | 1 | 23-10-2005 21.33.26 |
| Form HTML per accedere a cPanel | serverplan | Pannello di controllo Cpanel - Linux | 3 | 26-08-2005 11.11.08 |