i am going insane
Hi guys,
it may sound stupid that is because you know it but for me it drives me insane. Sometimes I read some tutorials in which their explanations are based on unix. I cannot stop reading them because i choose to study php.
I have a counter code to do the counting of users on my page. Here is it:
<?php
$dfile = "count_data.txt";
if(file_exists($dfile)) {
$inf = fopen($dfile, "r");
$count = fread($inf, 10);
$count = (int)$count;
$count++;
fclose($inf);
$outf = fopen($dfile, "w");
fputs($outf, $count);
fclose($outf); }
else { echo "File, $dfile, not found!"; } ?>
<center>
You are the
<?
echo $count;
$rem = $count % 10;
if (($rem >= 1) && ($rem <= 3)) {
if((($count % 100) >= 11) && (($count % 100) <= 13)) {
echo "th "; }
else {
switch ($rem) {
case (1): { echo "st "; break;}
case (2): { echo "nd "; break;}
case (3): { echo "rd "; break;}
default : { break; }
}
}
}
else { echo "th "; } ?>
visitor since --insert date here-- .
</center>
Now the question is how to use it on the php page and what exactly is the equivalent of this command in windows
chmod 666 public_html/count_data.txt
Thanks
Mo Jam
___________________
:hmm

