Zero2Cool
15 years ago
Okay, effective, umm, now. No more host switching until next off season. I'm going to focus on learning PHP in a similar fashion that I know ASP.NET.

Click HERE  to see the page.


Building the form, easy.
Coding the connection to the database, easy.
Grabbing the values from the radio buttons and storing them into variables to transfer to a database, kicking my ass.

I think I'm attacking this wrong because I'm using HTML code, but shouldn't I be able to use straight PHP code throughout?


Edit, here's how I'm starting out ...
http://w3schools.com/php/php_syntax.asp 

lol
UserPostedImage
IronMan
15 years ago
I have no idea what you are talking about, but thanks for keeping this site running!
djcubez
15 years ago
I'm not sure this will help you understand, my comments might not be helpful if you're just learning.

Save this as "pickem.php":

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Poop</title>
</head>

<?php 
// start php

// see if the GET variable "picks" is set
if(isset($_GET["picks"])) {
	// if picks is equal to "yes" proceed
	if($_GET["picks"] == "yes") {
		echo "<strong>You picked the following winners:</strong><br />";
		// if the GET variable "picks" is set, show picks
		// variables for the form are stored in an array called $_POST[]
		// the value for the array is the name of the input field i.e., rdoGame01
		// go through the post variable and display picks
		// assign variables
		$games = 16;	// number of games
		// if variable $x is less than the total number of games, add 1 to $x
		for($x = 0; $x <= 16; $x++) {
			// check games
			if($x < 10) {
				$x = "0" . $x . "";
			}
			if(isset($_POST["rdoGame" . $x . ""])) {
				// do whatever you want with each game right here
				if($x != "1") {echo ", ";}
				echo $_POST["rdoGame" . $x . ""] . "";
			}
		}
		echo "<br /><br />";
	}
}

?>

<body>
<form action="pickem.php?picks=yes" method="post">
<table width="372" border="1">
  <tr>
    <td colspan="4"><div align="center">Week One </div></td>
  </tr>

  <tr>
    <td width="56">Thursday</td>
    <td width="127"><input name="rdoGame01" type="radio" value="Titans" />
      Tenneesee </td>
    <td width="17">at</td>
    <td width="144"><input name="rdoGame01" type="radio" value="Steelers" />
      Pittsburgh</td>

  </tr>
 <tr>
    <td height="24">Sunday</td>
    <td><input name="rdoGame02" type="radio" value="Dolphins" />
      Miami </td>
    <td>at</td>
    <td><input name="rdoGame02" type="radio" value="Falcons" />

      Atlanta</td>
  </tr>
  <tr>
    <td>Sunday</td>
    <td><input name="rdoGame03" type="radio" value="Broncos" />
      Denver </td>
    <td>at</td>

    <td><input name="rdoGame03" type="radio" value="Bengals" />
      Cincinnati</td>
  </tr>
  <tr>
    <td>Sunday</td>
    <td><input name="rdoGame04" type="radio" value="Packers" />
      Minnesota </td>

    <td>at</td>
    <td><input name="rdoGame04" type="radio" value="Packers" />
      Cleveland</td>
  </tr>
  <tr>
    <td>Sunday</td>
    <td><input name="rdoGame05" type="radio" value="Packers" />

      Jacksonville </td>
    <td>at</td>
    <td><input name="rdoGame05" type="radio" value="Packers" />
      Indianapolis</td>
  </tr>
  <tr>
    <td>Sunday</td>

    <td><input name="rdoGame06" type="radio" value="Packers" />
      Detroit </td>
    <td>at</td>
    <td><input name="rdoGame06" type="radio" value="Packers" />
      New Orleans</td>
  </tr>
  <tr>

    <td>Sunday</td>
    <td><input name="rdoGame07" type="radio" value="Packers" />
      Dallas </td>
    <td>at</td>
    <td><input name="rdoGame07" type="radio" value="Packers" />
      Tampa Bay</td>
  </tr>

  <tr>
    <td>Sunday</td>
    <td><input name="rdoGame08" type="radio" value="Packers" />
      Philadelphia </td>
    <td>at</td>
    <td><input name="rdoGame08" type="radio" value="Packers" />
      Carolina</td>

  </tr>
  <tr>
    <td>Sunday</td>
    <td><input name="rdoGame09" type="radio" value="Packers" />
      Kansas City</td>
    <td>at</td>
    <td><input name="rdoGame09" type="radio" value="Packers" />

      Baltimore</td>
  </tr>
  <tr>
    <td>Sunday</td>
    <td><input name="rdoGame10" type="radio" value="Packers" />
      NY Jets</td>
    <td>at</td>

    <td><input name="rdoGame10" type="radio" value="Packers" />
      Houston</td>
  </tr>
  <tr>
    <td>Sunday</td>
    <td><input name="rdoGame11" type="radio" value="Packers" />
      Washington </td>

    <td>at</td>
    <td><input name="rdoGame11" type="radio" value="Packers" />
      NY Giants</td>
  </tr>
  <tr>
    <td>Sunday</td>
    <td><input name="rdoGame12" type="radio" value="Packers" />

      San Francisco</td>
    <td>at</td>
    <td><input name="rdoGame12" type="radio" value="Packers" />
      Arizona</td>
  </tr>
  <tr>
    <td>Sunday</td>

    <td><input name="rdoGame13" type="radio" value="Packers" />
      St. Louis</td>
    <td>at</td>
    <td><input name="rdoGame13" type="radio" value="Packers" />
      Seattle</td>
  </tr>
  <tr>

    <td>Sunday</td>
    <td><input name="rdoGame14" type="radio" value="Packers" />
      Chicago </td>
    <td>at</td>
    <td><input name="rdoGame14" type="radio" value="Packers" />
      Green Bay</td>
  </tr>

  <tr>
    <td>Monday</td>
    <td><input name="rdoGame15" type="radio" value="Packers" />
      Buffalo </td>
    <td>at</td>
    <td><input name="rdoGame15" type="radio" value="Packers" />
      New England</td>

  </tr>
  <tr>
    <td>Monday</td>
    <td><input name="rdoGame16" type="radio" value="Packers" />
      San Diego</td>
    <td>at</td>
    <td><input name="rdoGame16" type="radio" value="Packers" />

      Oakland</td>
  </tr>
 
</table>
<div><input type="submit" value="Submit Picks" /></div></form>
<p> </p>
</body>
</html>
Zero2Cool
15 years ago
Very awesome of you, thank you for taking the time to do that. Unfortunately, I have to go to sleep now, but hopefully I can spend some time on this tomorrow.
UserPostedImage
dhazer
15 years ago
good job dj +1 for the code
Just Imagine this for the next 6-9 years. What a ride it will be 🙂 (PS, Zero should charge for this)
UserPostedImage
Rockmolder
15 years ago

I have no idea what you are talking about, but thanks for keeping this site running!

"IronMan" wrote:

Porforis
15 years ago
As crazy inefficient as it is, this makes me miss Visual Basic (6, of course. None of that .net sorcery). As a kid I'd spend afternoons and weekends experimenting with code, not having the slightest clue what I was doing until I got it to work and figured out why. Nowadays I'm working with shell scripts (linux), I miss that fluid feel VB6 had. Didn't miss having to make API calls for some more advanced graphical manipulation and trying to learn directx, but at its core it was streamlined and not as unusable for higher-end applications as most people say...

Regardless, a bit off-topic I suppose. I guess some people like making websites, some people like making computer games, and then there's database nerds. 😛
Grabacr
15 years ago
Hooray...only spent $20000 on college so far and i understand the code....the system works!

good job man. Will have to see what i come up with in my spare time when im back at college
UserPostedImage
djcubez
15 years ago

good job dj +1 for the code

"dhazer" wrote:


Maybe I'll finally have to take you off my ignore list now :P

I feel like I click to read your posts half the time anyway hah.

@DKF295: I remember being a kid (not too long ago, in fact i'm probably still one now) and doing the same thing, albeit with websites. My dad was a website designer for over a decade so I kind of picked up the tools of the trade at a young age--not because I had too but because I found it fun.

@grabacr: I haven't learned an ounce about PHP or web design in college. In fact my teacher gave me a B in my web design course because she disliked that I knew almost everything already. I'm not saying I'm a genius or anything or that you won't learn anything in college, I just happen to learn things better on my own.
Zero2Cool
15 years ago
dj, would you be willing to help me with this project? You're PHP skills are far superior to mine. I'm only good editing existing code. I could figure it out on my own, but having a genius help me would speed things up for shizzle.
UserPostedImage
Fan Shout
packerfanoutwest (now) : show us a scenario where Pack don't get in? bet you can't
Zero2Cool (1m) : Falcons, Buccaneers would need to win final two games.
Zero2Cool (2m) : Yes, if they win one of three, they are lock. If they lose out, they can be eliminated.
packerfanoutwest (11m) : as I just said,,gtheyh are in no matter what
Zero2Cool (17m) : Packers should get in. I just hope it's not 7th seed. Feels dirty.
packerfanoutwest (19m) : If packers lose out, no matter what, they are in
packerfanoutwest (20m) : both teams can not male the playoffs....falcon hold the tie breaker
packerfanoutwest (22m) : if bucs win out they win their division
beast (31m) : Fine, Buccaneers and Falcons can get ahead of us
packerfanoutwest (37m) : falcons are already ahead of us
beast (40m) : Packers will get in
beast (41m) : If Packers lose the rest of their games and Falcons win the rest of theirs, they could pass us... but not gonna happen
packerfanoutwest (46m) : they still are in the playoffs
packerfanoutwest (47m) : If Packers lose the remaining games,,,,at 10-7
Zero2Cool (2h) : We can say it. We don't play.
Mucky Tundra (3h) : But to say they are in is looking past the Saints
Mucky Tundra (3h) : That said, their odds are very favorable with a >99% chance of making the playoffs entering this week's games
Mucky Tundra (3h) : Packers are not in and have not clinched a playoff spot.
buckeyepackfan (4h) : Packers are in, they need to keep winning to improve their seed#.
Mucky Tundra (13h) : Getting help would have been nice, but helping ourselves should always be the plan
beast (13h) : Too bad Seahawks couldn't beat Vikings
bboystyle (13h) : We just need to win Monday night and were in
Mucky Tundra (17h) : Or ties, but let's be real here
Mucky Tundra (17h) : Other scenario was Falcons+Rams losses
Mucky Tundra (17h) : Needed a Falcons loss for a Seahawk loss to clinch
buckeyepackfan (17h) : Am I wring in saying if Tge Vikings beat The Seahawks, The Packers clinch?
Mucky Tundra (21-Dec) : Agreed; you stinks
Zero2Cool (21-Dec) : I'm not beating anyone. I stinks.
Mucky Tundra (21-Dec) : rough injury for tank dell. guy can't catch abreak
beast (21-Dec) : So far the college playoffs have sucked... One team absolutely dominates the other
beast (21-Dec) : Well even if you weren't positive towards a guy, you wouldn't nessarily want to tell the media that (if they don't know about it)
Martha Careful (21-Dec) : I think MLF want Love to look past the end half issues, and feel good about his play. Our coaches generally keep a very positive tone.
beast (21-Dec) : I think a great running game will do that for most QBs
packerfanoutwest (21-Dec) : Coach Matt LaFleur has said quarterback Jordan Love is playing the best football of his career.
beast (21-Dec) : Oh, that's how you keep beating buckeye, with cheating
Zero2Cool (20-Dec) : There is a rule that if your name starts with 'b' you lose 15 points. Hey, I don't make the rules, I just enforce them!
wpr (20-Dec) : and then there is Beast. Running away with it all.
beast (20-Dec) : As of tonight, 3 way tie for 2nd in Pick'em, that battle is interesting!
beast (20-Dec) : Lions vs Vikings could be the main last game as it could determine division winners or #1 vs #2 seed
Mucky Tundra (20-Dec) : Or if KC needs to win for the #1 seed
Mucky Tundra (20-Dec) : Right now it looks like the only prime worthy games are Det-Minny and KC-Denver (if Denver can clinch a wild card spot)
Mucky Tundra (20-Dec) : The entirety of week 18 being listed as flex is weird
Zero2Cool (19-Dec) : Matt LaFleur today says unequivocally "Ted Thompson had nothing to do with the drafting of Jordan Love."
Zero2Cool (19-Dec) : Apparently, the editing is what pieces comments together. That Ted thing ... fake news.
Zero2Cool (19-Dec) : LaFleur "opportunity that Ted Thompson thought was too good to pass up"
Zero2Cool (19-Dec) : Jordan Love pick was Ted Thompson's idea.
Mucky Tundra (19-Dec) : Kyle Shanahan on signing De'Vondre Campbell as a FA last offseason: “We obviously made a mistake.”
packerfanoutwest (19-Dec) : Alexander’s last season with GB
Martha Careful (18-Dec) : if I were a professional athlete, I would probably look to see who the agent is for Kirk Cousins and then use him
beast (18-Dec) : $100 million fully guaranteed Kirk Cousins gets benched for rookie
Please sign in to use Fan Shout
2024 Packers Schedule
Friday, Sep 6 @ 7:15 PM
Eagles
Sunday, Sep 15 @ 12:00 PM
COLTS
Sunday, Sep 22 @ 12:00 PM
Titans
Sunday, Sep 29 @ 12:00 PM
VIKINGS
Sunday, Oct 6 @ 3:25 PM
Rams
Sunday, Oct 13 @ 12:00 PM
CARDINALS
Sunday, Oct 20 @ 12:00 PM
TEXANS
Sunday, Oct 27 @ 12:00 PM
Jaguars
Sunday, Nov 3 @ 3:25 PM
LIONS
Sunday, Nov 17 @ 12:00 PM
Bears
Sunday, Nov 24 @ 3:25 PM
49ERS
Thursday, Nov 28 @ 7:20 PM
DOLPHINS
Thursday, Dec 5 @ 7:15 PM
Lions
Sunday, Dec 15 @ 7:20 PM
Seahawks
Monday, Dec 23 @ 7:15 PM
SAINTS
Sunday, Dec 29 @ 12:00 PM
Vikings
Saturday, Jan 4 @ 11:00 PM
BEARS
Recent Topics
2h / Green Bay Packers Talk / Zero2Cool

13h / Green Bay Packers Talk / Mucky Tundra

22-Dec / Green Bay Packers Talk / packerfanoutwest

19-Dec / Green Bay Packers Talk / Zero2Cool

19-Dec / Random Babble / Zero2Cool

18-Dec / Green Bay Packers Talk / beast

17-Dec / Green Bay Packers Talk / wpr

17-Dec / Featured Content / Zero2Cool

16-Dec / Green Bay Packers Talk / beast

16-Dec / Green Bay Packers Talk / Martha Careful

16-Dec / Green Bay Packers Talk / beast

16-Dec / Feedback, Suggestions and Issues / Mucky Tundra

16-Dec / Green Bay Packers Talk / Zero2Cool

16-Dec / Green Bay Packers Talk / Zero2Cool

16-Dec / Green Bay Packers Talk / Zero2Cool

Headlines
Copyright © 2006 - 2024 PackersHome.com™. All Rights Reserved.