Page 1 of 1

Need help brainstorming for draft page

Posted: Sat Feb 28, 2009 10:03 pm
by NDTrack9
I've never used these forums before so I hope this is the right board section to post this in.

I've used php in the past to send emails using forms, update mysql databases, do other simple but functional things, etc...

Now I want to broaden my horizons a little. I'm looking to make my own fantasy cross country website. It would be just like fantasy baseball but instead it's for a more obscure sport, cross country. I have ideas on how I want to score it, what the rules would be and all of that. I could easily do this with 12 guys manually, but instead I want to start a site that can have multiple leagues for many players. I can handle the signup process, picking up free agents, making trades, scoring and all of that using mysql database tables and php... BUT, I have no idea how to do the drafting process. I want it to be a live draft where everyone logs in at the same time to make their picks, see who other people have drafted, talk amongst themselves and all of that good stuff. The only way I can think of doing this is using javascript to reload the page (or frames containing each part of the draft, ie the chat frame, the players left frame, the players selected on your team frame) every couple of seconds to check for changes in a database table... but that sounds way to sketchy to me. Do I need to learn java or another language? Can I pull off something like this in php? Is there a book or a web tutorial I could read that might help? I just need brainstorming ideas; I need something basic just to get me started.

Thank you very much,
Kevin

Re: Need help brainstorming for draft page

Posted: Mon Mar 02, 2009 7:06 am
by greyhoundcode
Sounds like a job that could do with a bit of AJAX, which in broad strokes is where your webpage can talk to PHP scripts on the server without reloading the page. Doesn't have to be PHP either, it can be whatever you like.

It's done through javascript but you don't have to be a JS guru to do it, and there are some existing bits of code out there to help you like Sajax.

Re: Need help brainstorming for draft page

Posted: Mon Mar 02, 2009 1:52 pm
by mickeyunderscore
I agree with greyhoundcode, certainly a job for AJAX. I'd recommend taking a look at jQuery, as that has some nice AJAX helper functions. Though this job sounds quite complex, if you are a beginner I'd start off slow and write some test scripts first, don't just jump straight in.