stats.chl questions

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
Kent
-


Joined: 12 Jan 2003
Posts: 137

PostPosted: Thu Apr 15, 2004 2:17 am    Post subject: stats.chl questions Reply with quote

I have seen how you guys have the stats to show on the page in stats.chl
by using code such as ^@StatUpTime^
is there a possible way of displaying the server log file with a likewise code on the stats.chl page without using an iframe? I want it to print out the logs line by line.. I hate having to open the log file with notepad... I tried doing this with php code but no matter what I do the chl page will not render any output for php......
I am asuming there is a way but I may be wrong can you clue me in aprelium???
Back to top View user's profile Send private message
Kent
-


Joined: 12 Jan 2003
Posts: 137

PostPosted: Thu Apr 15, 2004 4:06 am    Post subject: . Reply with quote

by the way this is the php code I was trying to get to work with the chl files
I setup chl files to be read like php files in the console area for php...why will this not work?
Code:

<?php

$filename ="c:\abs80\chl\access.txt";

$myFile = fopen($filename, "r");

if(! $myFile){ 

print ("File could not be opened.");

exit;
}

$fcontents = file($filename);


while (list ($line_num, $line) = each ($fcontents)) {
echo "<p><b>Line $line_num:</b> " . str_replace("<p>", "", $line) . "<br>\n";
}

fclose($myFile);

?>
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Apr 16, 2004 2:58 pm    Post subject: Re: . Reply with quote

Kent,

Syntax error:

Code:
$filename ="c:\abs80\chl\access.txt";


When you write a string in PHP, you must enter \\ to get a single \ because it is a special character.
So replace the quoted line with:
Code:
$filename ="c:\\abs80\\chl\\access.txt";

and retry your script.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group