Making a web form to manage chess ratings

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!

Moderator: General Moderators

Post Reply
savior
Forum Newbie
Posts: 2
Joined: Sat Feb 08, 2003 4:46 pm

Making a web form to manage chess ratings

Post by savior »

I'm looking to create a web form to calculate the chess rating for the players in my chess group.

The page has two drop down boxes and a "Submit" button. Each box has the players' names listed. The first box is for choosing the winner of the game being submitted, the second is for choosing the loser.

In the same folder as my form are files for the players' current rating. For example, my player name is "savior" and my current rating is 1200, so my file is called savior.txt and it contains the text "1200".

What I would like the script to do is, when the "Submit" button is clicked, access the text files that correspond with the winner and loser, get the numerical value contained in each, and then apply the rating formula to the values. Then I would like the movie to put the new value for each of the players' ratings into the text files in place of the old value.

Could someone tell me if this is even possible, first of all. And if so, I would love to get a little help creating it. I'm sorry to say that I've never actually built anything with PHP, but I catch on rather quickly, so you don't have to totally baby me. Any help would be GREATLY appreciated. Thanks.
savior
Forum Newbie
Posts: 2
Joined: Sat Feb 08, 2003 4:46 pm

Post by savior »

Oh, I forgot... I'd also like to make another page with a "Ratings" button, that, when pressed, pulls up a list of all of the players and their rating (in descending order, if possible).
oldtimer
Forum Contributor
Posts: 204
Joined: Sun Nov 03, 2002 8:21 pm
Location: Washington State

Post by oldtimer »

That is very doable. But it would be better if you stored all the information in a Database rather than a text file. Much easier to handle that way.

If you have access to have a database shoot me an email. Be happy to help you out. I love this type of things.

jerry@coastgames.com
User avatar
Skywalker
Forum Contributor
Posts: 117
Joined: Thu Aug 29, 2002 3:33 am
Location: The Netherlands

Post by Skywalker »

That is write you could better use a database, to manage the scores, it is easyer to callculate the new values, because it stores them again in the samen tabel etc.

You could then also insert a new user much easyer then with an tekst file. It is easyer to get al your information with litle capasity.

Greathings Skywalker
Post Reply