Parsing a text file to display certain data on my website in php?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Parsing a text file to display certain data on my website in php?
Hi! ^^
Im trying to figure out how to display parts of a .db file created by the scorch2000 server to display a player name, games played, score and maybe more...
I dont want to display everything, of course ^^, but how do i get the player name, the number of games he played and his score to display it in a webpage in this fasion:
Name Games Played Score
joe blow1 25 9876890
joe blow2 31 8989767
joe blow2 26 7989767
joe blow2 17 5989767
joe blow2 13 4989767
and by highest score because the log doesin't put them in in score order....
please help, i asked the maker because he has one runing already but no answer back, well the game is pretty old so i didn't really expect an answer anyways and tryed to figure it out but i dont know functions in php, this is to include in a php-nuke block (this i know how to do
Seriously if you have a paypal account it would be my pleasure to give you a little something , im not rich but i'll give you what i can....
you can send your info here admin@excelclan.com if you wish,, like i said it would be a pleasure because this is actually the first code i know that is tailor made for this classic game server so i thank you VERY much and is very much appreciated ^^
This works great but puts all of the line in playername1,, how do i display only the player name in that field, then in the next the numbers of games he player then after that the score in the next field? or how does the script work?
Also i cant copy paste the players.db file because it only copies the first word of the file in notepad++ because of the NUL symbols (dont know why) so i have attached a picture of the file....
Last edited by jumperbee; 12-27-2009 at 05:50 PM.
Reason: picture
ok i figured out that $line_arr = explode(' ', $buffer); this is the value that takes in to account that after the space it becomes the next value, but in this log file there is a NUL symbol, what is this?, what can i put between the quotes in $line_arr = explode('HERE', $buffer); to represent that NUL symbol?
ok the problem is that the server removes those NUL symbols and i loose the spaces,, is there a way to read that file with this script while keeping the spaces?
or can i copy this file to the location of this script, covert it to another format and read it,, but how or with what do i convert it?, i know how to copy it with cron and all but what program on an ubuntu server can i use to convert this file to unicode or a format wich keeps the spaces?
kewwwwlll!,, ok i checked the link you provided on the explode() argument but i cant see anything that explains on how to print only chunks of a line, for example mine has 14 values,, but how do i only print the name, the numbers of games played and the score?, because the other values are passwords and e-mails i wouldn't want to display that to the public.....
if you dont feel like explaining can you provide me with the argument i can use to do this?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.