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
Zero2Cool (12m) : I would think it would hurt the home team because people would have to cancel last minute maybe? i dunno
beast (20m) : I agree that it's BS for fans planning on going to the game. But how does it bring in more money? I'm guessing indirectly?
packerfanoutwest (32m) : bs on flexing the game....they do it for the $$league$$, not the hometown fans
Zero2Cool (1h) : I see what you did there Mucky
Zero2Cool (1h) : dammit. 3:25pm
Zero2Cool (1h) : Packers Vikings flexed to 3:35pm
Mucky Tundra (1h) : Upon receiving the news about Luke Musgrave, I immediately fell to the ground
Mucky Tundra (1h) : Yeah baby!
Zero2Cool (1h) : LUKE MUSGRAVE PLAYING TONIGHT~!~~~~WOWHOAAOHAOAA yah
Zero2Cool (2h) : I wanna kill new QB's ... blitz the crap out of them.
beast (3h) : Barry seemed to get too conservative against new QBs, Hafley doesn't have that issue
Zero2Cool (3h) : However, we seem to struggle vs new QB's
Zero2Cool (3h) : Should be moot point, cuz Packers should win tonight.
packerfanoutwest (4h) : ok I stand corrected
Zero2Cool (4h) : Ok, yes, you are right. I see that now how they get 7th
Zero2Cool (4h) : 5th - Packers win out, Vikings lose out. Maybe?
beast (4h) : Saying no to the 6th lock.
beast (4h) : No, with the Commanders beating the Eagles, Packers could have a good chance of 6th or 7th unless the win out
Zero2Cool (4h) : I think if Packers win, they are locked 6th with chance for 5th.
beast (4h) : But it doesn't matter, as the Packers win surely win one of their remaining games
beast (4h) : This is not complex, just someone doesn't want to believe reality
beast (4h) : We already have told you... if Packers lose all their games (they won't, but if they did), and Buccaneers and Falcons win all theirs
Zero2Cool (4h) : I posted it in that Packers and 1 seed thread
Zero2Cool (4h) : I literally just said it.
packerfanoutwest (4h) : show us a scenario where Pack don't get in? bet you can't
Zero2Cool (4h) : Falcons, Buccaneers would need to win final two games.
Zero2Cool (4h) : Yes, if they win one of three, they are lock. If they lose out, they can be eliminated.
packerfanoutwest (4h) : as I just said,,gtheyh are in no matter what
Zero2Cool (4h) : Packers should get in. I just hope it's not 7th seed. Feels dirty.
packerfanoutwest (4h) : If packers lose out, no matter what, they are in
packerfanoutwest (4h) : both teams can not male the playoffs....falcon hold the tie breaker
packerfanoutwest (4h) : if bucs win out they win their division
beast (4h) : Fine, Buccaneers and Falcons can get ahead of us
packerfanoutwest (5h) : falcons are already ahead of us
beast (5h) : Packers will get in
beast (5h) : If Packers lose the rest of their games and Falcons win the rest of theirs, they could pass us... but not gonna happen
packerfanoutwest (5h) : they still are in the playoffs
packerfanoutwest (5h) : If Packers lose the remaining games,,,,at 10-7
Zero2Cool (6h) : We can say it. We don't play.
Mucky Tundra (8h) : But to say they are in is looking past the Saints
Mucky Tundra (8h) : That said, their odds are very favorable with a >99% chance of making the playoffs entering this week's games
Mucky Tundra (8h) : Packers are not in and have not clinched a playoff spot.
buckeyepackfan (8h) : Packers are in, they need to keep winning to improve their seed#.
Mucky Tundra (17h) : Getting help would have been nice, but helping ourselves should always be the plan
beast (18h) : Too bad Seahawks couldn't beat Vikings
bboystyle (18h) : We just need to win Monday night and were in
Mucky Tundra (21h) : Or ties, but let's be real here
Mucky Tundra (21h) : Other scenario was Falcons+Rams losses
Mucky Tundra (21h) : Needed a Falcons loss for a Seahawk loss to clinch
buckeyepackfan (21h) : Am I wring in saying if Tge Vikings beat The Seahawks, The Packers clinch?
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 @ 3:25 PM
Vikings
Saturday, Jan 4 @ 11:00 PM
BEARS
Recent Topics
8m / Green Bay Packers Talk / beast

2h / Green Bay Packers Talk / Zero2Cool

3h / Random Babble / Martha Careful

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

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