Frag Infinity Tournament, Inc. - FITES LAN Party - www.fites.net
LAN Party Forums => Support Group => Started by: .:F3ar0n:. on September 04, 2008, 12:06:57 PM
-
Ok, so I have this tron server which automatically creates several txt files displaying statistics of the game. It'll display the ladder, matches won, rounds won, who's online and so on.
So I want to create a page to display these stats to the user. I originally was going to display them using an iframe which would separate the page into 4 frames...top being who's online, and from left to right the ladder, match won and rounds won
I do a php include "rounds.txt" and it outputs the txt file to the page but there is no organization
http://fight-clan.wwwd.name/test.php
So my question would be...how could I import a txt file then organize it to display everything in a clean list. Do I have to import the txt file into a database and then recall the database as a organized list (I've done this before with ASP but never in PHP)
I assumed this would be what I would have to do therefor I have the tron server automatically ftp'ing the stats data to both my personal server (which has php and mysql installed) and to server who is hosting it
http://fight-clan.wwwd.name/index.php?topic=46.msg195#new
If i have to upload the file into a database in order to recall it..How would I go about having the file automatically update to the database every 10 min or w/e? Any advice or linkage on this would be helpful. Until then i'll continue my search on google for the answer
**prays someone here has advance web dev skillz
-
The reason the text is in disarray is because all you are doing is displaying the text file as it is being written by the server. You can open the file with the FOpen (http://us.php.net/manual/en/function.fopen.php) function. You can then read it line by line and format it how you want. Loading the file on a periodic basis would require a cron job but putting the output into the mysql database.
-
I prefer file_get_contents.
http://us.php.net/manual/en/function.file-get-contents.php
Then you have it in one variable. No need to enter it into a database. And you can parse as you like. I think both functions are good, but the one I am talking about can pull from other sites and the file doesn't need to be on the same server as the webserver.