By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

Script for "team picking"


New Coder
Hey guys. I'm new here so I don't know if my question is in the right section. Feel free to move it to the right section.

So I'm starting a Fantasy Sports Manager website. Because I don't really want to give away my whole concept, let's use football as the sport. While I'm working on the design and styling (which goes pretty good) I was wondering what language/script/tools/whatsoever I need to create a "team-picking"-page. I've already covered the register/login section.

- In a particular time and date window, users will be able to select x amount of real footballers with a certain budget. Once clicked upon the footballer in the table, it will automatically go in their "draft" section, next to the table. Lets say our starting budget is 20.000 points and footballer John Smith is worth 3000 points. Once clicked upon John Smith, he should appear in the draft and the remaining budget would be shown as 17.000. If I would remove him from the draft, he will disappear and the budget will go back to 20.000.
- There would also be an option to erase the whole draft.
- Once they are done, they need to save the squad but they'll have time to edit the team if the window hasn't closed yet.

There's still a couple more features but these are the basics. Once again, if I'm in the wrong section, move it please.

Thanks for reading,

What languages are you using for the login / registration?

I'm a PHP dev, so I would build all this in PHP with some AJAX / Javascript. You have the user's balance, say 20,000 points. For each footballer, you do an AJAX request that updates the user's session with their choice and the amount of points the user has remaining after the pick. You can either do this in real time, eg if I select a footballer my points are instantly deducted, or you can keep track of the user's selections and have them click a "finalize" button to save their selection. Then update the front end with Javascript based on the response you get from your server side code that is calculating the points, eg update the button of the person to say "selected" and update the new balance of the user.
I was planning on doing it only using html and css. But that needs to be connected to a database, right? And I would like to have the selection in real time, so the players dont have to start counting.
Yeah, you'll need a database to keep track of who users are as well as their points total as well as the players they have picked. You can keep track in real time, you'll just need to have some AJAX that fires when a user selects a player that updates their points total as well as which player the user has picked. Then you'll store that selection in a database so the user can come back to the site and see their picks.

New Threads

Latest posts

Buy us a coffee!

Top Bottom