Need to get pointed in the right direction-

bGIveNs33

Golden Member
Jul 10, 2002
1,543
0
71
I'm helping a friend with a website. I have plenty of free time this summer and it's something I've always wanted to learn. I know HTML okay and have helped set up websites on the hosting side. This is basically what I need to happen. It's going to be a game similar to NFL survival leagues. For those who aren't familiar with that you basically pick one team a week that you think will win. But you can't use the same team more than once. This is for a college team so you will be picking players, but the idea is the same. Graphically, I don't care that much. I am going to focus most efforts on ease of use and making sure it functions perfectly. So, given that... I know I'm going to have to have users login to make sure they don't select the same player more than once. A very primitive setup would look like this-

Person logs in-

There is a display of the season's schedule.
You select the game for that week.
You see the entire roster for the football team.
You fill in a bubble next to the name you want.
Click save.

Next week-
Same thing except the player you chose last week is grayed out.

Up top you have 3 selections - Home(where the season is displayed) Weekly High Scores and Season High Scores.

I've got most of the math worked out to help even out all of the positions so the choice between a QB and a DT is not going to be an easy one.

Now, I don't have much experience with this at all but I am a quick learner. Would PHP and MySQL be the best to do this with? I've been looking at some programs to do it in, but I might just do it in text editor(I'm on Ubuntu). Can someone point me in the right direction? I plan on spending the next 2 weeks paper planning it and engrossing myself into every topic I will need to know. Sorry this is long.

TIA,
Bill
 

hellod9

Senior member
Sep 16, 2007
249
0
0
I would do it in PHP/MySQL, but that's because its the only language I know

If you are new to programming, I wouldn't recommend doing too much initial planning. Just dive in and write some code. It will probably be messy/crappy code, but you'll learn a lot. Once you finally feel like you've gotten somewhere, scrap the whole thing and start again, using all of the lessons you've learned. And then once you've gotten somewhere with that, scrap the whole thing and start again

The point is, you'll learn a lot just by doing it.

Also, download some open source programs and study the code. You'll learn some things there too.
 

Vogel515

Senior member
Jun 17, 2005
249
0
0
Download XAMPP I believe it is available for Linux...

That'll give you Apache / MySQL and let you set up a test environment on your computer.

Then I think you should map out what you want. When you do start coding start with low hanging fruit - ex. use PHP to highlight or underline the link to the page the user is currently on - from there go into slightly more difficult things - forms, etc - after that you can start tackling stuff like pulling from external data sources.

Most of your validation will be down client-side, this will require some JavaScript.

I do agree with Hellod when he says to scrap and re-do, but I believe the planning is important with each cycle, you will learn what tools you can use where. Keep this in mind though:

PHP -> Server side, good for passing information from the website to MySQL
MySQL -> DB, stores your information and allows you to manipulate it
Javascript -> client side, use this for your validation or anything that doesn't need to be done on the server, IE make sure they don't select a team they picked in previous weeks.
HTML/CSS -> this determines how everything displays, if you don't know CSS - learn it.
 

bGIveNs33

Golden Member
Jul 10, 2002
1,543
0
71
Originally posted by: Vogel515
Download XAMPP I believe it is available for Linux...

That'll give you Apache / MySQL and let you set up a test environment on your computer.

Then I think you should map out what you want. When you do start coding start with low hanging fruit - ex. use PHP to highlight or underline the link to the page the user is currently on - from there go into slightly more difficult things - forms, etc - after that you can start tackling stuff like pulling from external data sources.

Most of your validation will be down client-side, this will require some JavaScript.

I do agree with Hellod when he says to scrap and re-do, but I believe the planning is important with each cycle, you will learn what tools you can use where. Keep this in mind though:

PHP -> Server side, good for passing information from the website to MySQL
MySQL -> DB, stores your information and allows you to manipulate it
Javascript -> client side, use this for your validation or anything that doesn't need to be done on the server, IE make sure they don't select a team they picked in previous weeks.
HTML/CSS -> this determines how everything displays, if you don't know CSS - learn it.


Ok, I have engulfed myself with CSS(which I was somewhat familiar with), PHP and touched up on HTML. I'm feeling a bit better about this now. The professor did make the statement that he knew there are a plethora of scripts out there right now(i.e. login etc.) and they aren't off limits. But we can expect to have to answer questions about what exactly they are doing. I'd prefer not to use them, but if I get in a crunch they are available.

I have basically followed your formula and it is making sense now.. I am working on the basics of the page but I have a few questions that I will be facing shortly-

Ok, the javascript login. I have been reading up on that and it still confuses me a bit. Once the javascript validates the user, is it going to pull that users own personal page? Will the url read www.xxxxx.com/user@password/ ?? Is that how it's going to keep track of it?

Secondly(a bit further down the road), once a week of football has completed I will have to go in a manually input the stats for each player. I don't want to have to input everyone's score, I want to set it up so once the stats are entered... scores are automatically computed. So for example-

Player 1 chose Joe Smith(QB) for this week
Player 2 chose John Doe(RB) for this week
Player 3 chose Hard Hitter(LB) for this week

So I would then have to login and input the stats for that week for those three football players.

I have the math formulas in which I would like that stats run through in order to get a score. How do I set it up to do that? Would I run the calculations in MySQL or keep the raw stats(i.e. 200 yds pass, 3tds 1int) and pull it into PHP and calculate it then? Worse comes to worse, I can calculate the score by hand and put that number into MySQL and have PHP pull it out of there. But I think the idea is to have it as automated as possible. Am I even thinking about this the right way? This is the one big hurdle I know I'm going to have to face so I'm just trying to get a head start on it.

I appreciate ALL of the help from everyone. I'm having a blast doing this, so at least I'm motivated to learn.

Crusty- I looked at Ruby on Rails... I might save that for next project
 

thirtythree

Diamond Member
Aug 7, 2001
8,680
3
0
Originally posted by: bGIveNs33
Ok, the javascript login. I have been reading up on that and it still confuses me a bit. Once the javascript validates the user, is it going to pull that users own personal page? Will the url read www.xxxxx.com/user@password/ ?? Is that how it's going to keep track of it?

You'll want to use PHP and MySQL to authenticate users. The login and password should be passed using POST rather than GET, so they wouldn't show up in the URL.

I recently set up a fairly simple login for a blog. Basically it takes the input from a login form, MD5 hashes the password using JavaScript before submitting, checks the user name and hashed password against the user name and hashed password stored in a database, and, if they match, creates a session variable identifying the individual. I'm rather new to PHP/MySQL myself, and I don't actually use the blog, so I can't comment on how secure this method is. Their session will end if they log out, close their browser, or after a set period of time.

You'll also want to be sure to learn about preventing SQL injections.

Secondly(a bit further down the road), once a week of football has completed I will have to go in a manually input the stats for each player. I don't want to have to input everyone's score, I want to set it up so once the stats are entered... scores are automatically computed. So for example-

Player 1 chose Joe Smith(QB) for this week
Player 2 chose John Doe(RB) for this week
Player 3 chose Hard Hitter(LB) for this week

So I would then have to login and input the stats for that week for those three football players.

I have the math formulas in which I would like that stats run through in order to get a score. How do I set it up to do that? Would I run the calculations in MySQL or keep the raw stats(i.e. 200 yds pass, 3tds 1int) and pull it into PHP and calculate it then? Worse comes to worse, I can calculate the score by hand and put that number into MySQL and have PHP pull it out of there. But I think the idea is to have it as automated as possible. Am I even thinking about this the right way? This is the one big hurdle I know I'm going to have to face so I'm just trying to get a head start on it.

I think the best way to do it would be to enter the stats into the database and calculate the scores using PHP. You could even set it up so that you calculate the scores once with PHP after entering the stats, then store those scores in a separate table. That way you wouldn't have to run all the calculations each time someone checked their score. (I don't know much about fantasy football, so I don't know how complicated the calculations are, if it's a running score or weekly scores, etc.)

EDIT: And incidentally, my login method wouldn't work so well if someone had JavaScript disabled... You can also hash with PHP, but that means the password will be passed from the user to you in plain text.
EDIT2: Now that I think about it, hashing it client-side probably doesn't add much security. I read an article that suggested doing it for some reason. SSL was out of the question for me since I just created the site for fun. I assume your friend won't have a secure connection either, eh?
 

reverend boltron

Senior member
Nov 18, 2004
945
0
76
I really recommend Drupal for this. Drupal is a great way to do your content management system, it is really really secure, so you're not going to have to worry much about SQL injections or other security issues since they have an entire team working on the Drupal core.

There is so much documentation and so many modules for it that you can definitely find what you're looking for.

This will also teach you about PHP and MySQL too, since you're going to have to get your hands dirty and do some tweaking with modules and probably creating your own as well.

This will speed up your development by an insane amount too. I would recommend, if you really want to learn how to do this on your own too, to get your feet wet with this, and pool your resources so you actually get it done. There were so many projects of mine that died because of slow development and not knowing all that was involved.

If you have any questions feel free to PM me or email me.
 

bGIveNs33

Golden Member
Jul 10, 2002
1,543
0
71
Ok, the site is coming along nicely and I'm facing my biggest hurdle yet with database design. I had guessed coming into this, the effectiveness of the site would hinge on a good design. I've been reading everything I can get my hands on... particularly a book that was recommended called PHP and MySQL for Dynamic Websites(by Larry Ulman). I think I've got a grasp on how to create the database but I had a few questions-

I'm still a bit confused on what is the technical difference between a database and a table. I know that a database is made up of tables but what can you use in multiple tables and what would you have to put in separate databases? I have read(and reread several times) the process of normalization and it still is a bit fuzzy. Here is the base question-

I am going to have to input stats on a weekly basis so I'm wondering if I can set up the database like this...

StatsDB

Tables-
Week1
Week2
Week3

ect.

Colums-
QB
RB
WR
etc.

Values per column-

Players Number(primary key)
First
Last
PassYds
RushYds
TDs
RecYds
etc.

I guess the problem is I fully expect a running back to not have any pass yds and a QB to not have any receiving yds. Is that going to be a problem if I just put in zero for those values? The secondary solution would be to make a different database for each week-

Week1DB
Week2DB

Tables-
QB
RB
WR

etc.

I'm really trying to make this as efficient as possible so I'd much rather do the first one. And on a side note to clarify my previous question about turning the stats into a score, I plan on making a secure page that has a form for all of the stats. I could then pull the stat lines from the StatsDB and then convert them to a fantasy score and post them into a ScoresDB. Is that feasible?

Thanks in advance, I know this is a long question... I have appreciated and heeded everyone's input so far.
 

aceO07

Diamond Member
Nov 6, 2000
4,491
0
76
Think of a database as a big filing cabinet, each table as a single drawer in the cabinet and records/rows as files in each drawer.

In general a database contains all information/data related to a project. In your case, there's be a single database for your fantasy football.
In this database, there'd be various tables - Players, Stats, etc.

In the Players table, you'd have records that has the following columns - First name, last name, team.. etc. In Stats table, you'd have timeperiod(week#), player_id, yards_rushed..etc

I do know much about fantasy footballs or any of the stats on it, so I don't know what information needs to be recorded. I would suggest doing some reading on database and db design. It will help to make sure your tables work out and the design doesn't become too messy.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |