PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
it'd be better to use a database, esp with that many people hitting the page that often.. otherwise you risk having LOTS of collisions with adding names..
anyway, so here's the basics...
I'd use [php_man]file_get_contents[/php_man] to load in the file. Then I'd combo the username into [php_man]preg_match[/php_man] with [php_man]preg_quote[/php_man]. Afterwhich, if the user isn't in the "database", I'd add them on the end. If they are in the "database", I'd [php_man]preg_replace[/php_man] them adding/fixing the number up one..
Last edited by feyd on Wed Aug 25, 2004 12:39 am, edited 1 time in total.
I have no clue i just took ur code under the fwrite code and saved the script
and i renamed everything that is $username to $user
what should i change "a" to so it will overwrite? "ow" ?
lol i thought that a was useless
Ok Thanks i found a little guide
r - open for reading
w - open for writing (file need not exist)
a - open for appending (file need not exist)
r+ - open for reading and writing, start at beginning
w+ - open for reading and writing (overwrite file)
a+ - open for reading and writing (append if file exists)
Meh now it shows only 1 name per log
Last edited by PHPScripter on Wed Aug 25, 2004 1:48 am, edited 3 times in total.