Jest Posted February 10, 2007 Share Posted February 10, 2007 Hi everyone, I am new to PHP and am trying to add it into my website. I have a form to sign up for registration for an event and need a counter of all people to register and a list of registered people. This counter from the PHP Code Library is the one I want to use. $file = "counter.txt"; if ( !file_exists($file)){ touch ($file); $handle = fopen ($file, 'r+'); $count = 0; } else{ $handle = fopen ($file, 'r+'); $count = fread ($handle, filesize ($file)); settype ($count,"integer"); } rewind ($handle); fwrite ($handle, ++$count); fclose ($handle); } The other thing I need is similar. When someone registers I add their name to a txt, sorted into alphabetical order. Can anyone help me out with this? Link to comment https://forums.phpfreaks.com/topic/37908-simple-counter-and-list-of-registered-users/ Share on other sites More sharing options...
Jest Posted February 14, 2007 Author Share Posted February 14, 2007 *bump* Link to comment https://forums.phpfreaks.com/topic/37908-simple-counter-and-list-of-registered-users/#findComment-184702 Share on other sites More sharing options...
boo_lolly Posted February 14, 2007 Share Posted February 14, 2007 you should consider storing this information into a database instead of a flatfile. Link to comment https://forums.phpfreaks.com/topic/37908-simple-counter-and-list-of-registered-users/#findComment-184708 Share on other sites More sharing options...
Jest Posted February 14, 2007 Author Share Posted February 14, 2007 I don't know anything about Databases. I do have access to a MySQL database though. Any ideas? Link to comment https://forums.phpfreaks.com/topic/37908-simple-counter-and-list-of-registered-users/#findComment-184715 Share on other sites More sharing options...
boo_lolly Posted February 14, 2007 Share Posted February 14, 2007 I don't know anything about Databases. I do have access to a MySQL database though. Any ideas? if you're going to get into php, you need to get into mysql (or a database of some persuasion). my suggestion is to start here: w3schools php, tizag php, tizag mysql, php/mysql tutorial, freewebmasterhelp... and of course the manual. that should get you goin. Link to comment https://forums.phpfreaks.com/topic/37908-simple-counter-and-list-of-registered-users/#findComment-184723 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.