Hi:

I have two types of counters in my web site and I would like
to know which one is better.

a) the first one using a field in mysql table and updating it each time
a visitor hits the page.

b) the second one using a plaint text file using code like this:

<?
$counter_file = "counterfile.txt";
$linecounter = file($counter_file);
$linecounter[0]++;
$cf = fopen($counter_file, "w");
fputs($cf, "$linecounter[0]");
fclose($cf);
echo "$linecounter[0]";
?>
in this case i had to change the permission of the file to:
chmod 666 counterfile.txt

My questions are:
1. Which is more efficient in terms of time, i.e. accessing a database or
accessing a text file?
2. is the second counter secure? is there a possibility that the file
counterfile.txt (with those
   permissions) can be used as a insecure door to my web server?

Thanks in advance for your help.












_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to