Sponsor Advertisements help keep UGN Security Online.
Sponsor Advertisements help keep UGN Security Online.
Want to earn prizes for clicking online advertisements? Join Rewards1.com.
|
|
|
#19047 - 10/20/05 01:00 AM
php help (I think)
|
UGN Member
Registered: 09/25/02
Posts: 390
Loc: Asheville, NC
|
What up bitches, I never ask for help, but on this I am truly stumped..... I'm trying to make a public web stats section on my webpage. To display:
Today's Hits: Today's Unique Hits: Total Unique Hits:
I can't seem to it it to work how I want it to. The only condition is that no mysql database. I do not have mysql installed and setup and I really do not want to do it cause... Well I'm lazy. But if anyone has any ideas. Please Help would be greatly appreciated
_________________________
"The secret to creativity is knowing how to hide your sources." -Albert Einstein Tech Ninja Security
|
|
Top
|
|
|
|
Sponsor Advertisements help keep UGN Security Online.
Sponsor Advertisements help keep UGN Security Online.
|
|
#19049 - 10/20/05 01:51 AM
Re: php help (I think)
|
UGN Member
Registered: 09/25/02
Posts: 390
Loc: Asheville, NC
|
I do have a reports page that show me all of this, and perl is active. However the reports page is...fucked up is the best way I can describe it
_________________________
"The secret to creativity is knowing how to hide your sources." -Albert Einstein Tech Ninja Security
|
|
Top
|
|
|
|
#19052 - 10/20/05 05:11 AM
Re: php help (I think)
|
UGN Member
Registered: 09/25/02
Posts: 390
Loc: Asheville, NC
|
Well the thing is I don't want a whole page dedicated to stats, its just a little portion of the main page. So all I need is something that counts hits, unique hits and total unique hits, and generates a normal looking number. To be displayed on the index page.
_________________________
"The secret to creativity is knowing how to hide your sources." -Albert Einstein Tech Ninja Security
|
|
Top
|
|
|
|
#19057 - 10/20/05 04:07 PM
Re: php help (I think)
|
UGN Member
Registered: 09/25/02
Posts: 390
Loc: Asheville, NC
|
I gotcha now, thanks a lot sintax
_________________________
"The secret to creativity is knowing how to hide your sources." -Albert Einstein Tech Ninja Security
|
|
Top
|
|
|
|
#19059 - 10/20/05 08:31 PM
Re: php help (I think)
|
UGN Member
Registered: 09/25/02
Posts: 390
Loc: Asheville, NC
|
Yes yes, it should be a learning experience for me as well. I'm actully getting started on it right.... .... ..... ...... .......
NOW
hehe I'll keep you updated as to how it went.
_________________________
"The secret to creativity is knowing how to hide your sources." -Albert Einstein Tech Ninja Security
|
|
Top
|
|
|
|
#19060 - 10/20/05 09:30 PM
Re: php help (I think)
|
UGN Member
Registered: 09/25/02
Posts: 390
Loc: Asheville, NC
|
these damn tutorials are like pulling teeth...
_________________________
"The secret to creativity is knowing how to hide your sources." -Albert Einstein Tech Ninja Security
|
|
Top
|
|
|
|
#19061 - 10/20/05 10:35 PM
Re: php help (I think)
|
UGN Member
Registered: 09/25/02
Posts: 390
Loc: Asheville, NC
|
ok finally got it if anyone is intersted I'll put the code here... totalhits.php <?php
$myfile = "totalhits.txt";
//Assigns file name to the variable we'll use to handle it
if(file_exists($myfile))//if the file exists
{ // runs counter script
$var = fopen( $myfile,'r+');
//opens in read and write mode for file
$visits = fread($var,filesize($myfile));
//puts the content of the file for its whole length
rewind( $var );
//resets the file position indicator to the beginning
$visits++; //increments the actual number of vists by 1
fwrite($var, $visits);
//writes on the variable the actual (incremented) value
fclose($var);//closes our file reference
}
else
{
print "File $myfile doesn't exist...";
Die();
//if the file doesn't exist prompts a warning and kills the script
}
$message = sprintf("Total Hits: %s",$visits);
//saves our visits message in a variable ($message) that will be used as output
print $message;
?> Code in index.php <?php include 'totalhits.php'; ?> only question I have is permissions... The txtfile has to be 777, thats the only way it will work... is that correct? Wait... I can use .inc......
_________________________
"The secret to creativity is knowing how to hide your sources." -Albert Einstein Tech Ninja Security
|
|
Top
|
|
|
|
#19062 - 10/20/05 10:36 PM
Re: php help (I think)
|
UGN Member
Registered: 09/25/02
Posts: 390
Loc: Asheville, NC
|
sorry thinking while posting...
_________________________
"The secret to creativity is knowing how to hide your sources." -Albert Einstein Tech Ninja Security
|
|
Top
|
|
|
|
#19064 - 10/20/05 11:03 PM
Re: php help (I think)
|
UGN Member
Registered: 09/25/02
Posts: 390
Loc: Asheville, NC
|
Well I changed them to .inc, and moved them out of the main directory to a hidden on, I'm now changing the chmod to 666 to see if it works. TY for all the help sintax, it was not as hard as I had first thought 
_________________________
"The secret to creativity is knowing how to hide your sources." -Albert Einstein Tech Ninja Security
|
|
Top
|
|
|
|
|
Registered: 03/01/02
Posts: 505
|
|
2198 Members
46 Forums
24782 Topics
59952 Posts
Max Online: 1567 @ 04/25/10 10:20 AM
|
|
|
0 registered (),
311
Guests and
263
Spiders online. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|