Web Hosting Talk







View Full Version : cPanel Awstats on my page


UrlGuy
03-28-2005, 11:48 AM
Hi,

Im trying to let some "VIP" users be able to view Awstats for my page, which is a stat-system in cPanel.

I can query the page and all, but when I am about to recieve the results I get this:

HTTP/1.0 200 OK Server: cpsrvd/10.0.0 Connection: close Content-type: text/html; charset= Cache-Control: public Last-Modified: Mon Mar 28 15:43:52 2005 Expires: Mon Mar 28 15:43:52 2005 Statistics for poetzsch.org (2005-03) Your browser does not support frames. You must set AWStats UseFramesWhenCGI parameter to 0 to see your reports.

Normally the stats system is a feature rich page with several images, I am not sure how to let my PHP script open this page as it gives me that above error.



This is the script I use: (stats.php)



<?php



$request = "/awstats.pl?config=$domain&lang=en";

$result = cprq($host,$port,$cpanel_username,$cpanel_password,$request);

$show = strip_tags($result);

echo "$show<br><br>";

function cprq($host,$port,$ownername,$passw,$request) {
global $email,$password;
}

?>



All I need is, some user to request this page stats.php and I want it to show the stats, as its shown in cPanel.


Hope anyone can help me with this advanced task
Thanks in advance,
Kind Regards ~UrlGuy

UrlGuy
03-28-2005, 12:04 PM
When I try to run the script, I get one of these back:

http://user:pass@localhost.com:2082/awstats.pl?config=domain.com&lang=en


OR



HTTP/1.0 200 OK Server: cpsrvd/10.0.0 Connection: close Content-type: text/html; charset= Cache-Control: public Last-Modified: Mon Mar 28 15:43:52 2005 Expires: Mon Mar 28 15:43:52 2005 Statistics for domain.com (2005-03) Your browser does not support frames. You must set AWStats UseFramesWhenCGI parameter to 0 to see your reports.



But its not showing me a statpage! Just these two things which are showed in plain text.

I have also seen an other script for this, but it did now work for me and I want to make my own.

I want some members of my page, be able to view my Awstats for my page, without accessing cPanel directly.

But its not showing me any stat-page, only those 2 text's, Id want it to show like a full page with images and all

Hope anyone can help me out here, or lead me in a direction which can help me out

Thx in advance =)

UrlGuy
03-28-2005, 12:48 PM
So I need to request a page in php, and return it in (including the look, images etc.)

UrlGuy
03-29-2005, 01:16 AM
anyone...? :\

joshuayip
03-29-2005, 02:26 AM
Some good samaritan did a hack on this

http://josheli.com/vox/

Joshua

LevelServe Admin
03-30-2005, 09:18 PM
Originally posted by joshuayip
Some good samaritan did a hack on this
Joshua

Hey thanks for that link.....There is some sweet stuff there.