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
dfosterf (25-Jul) : It's my one day deal complaint dept. on shareholder meeting day
dfosterf (25-Jul) : Probably a homer access credential intimidation kinda thing
dfosterf (25-Jul) : Meathead "journalists" skip this, concentrating on operational revenue when convenient. They switch when net revenue is more favorable.
dfosterf (25-Jul) : Resulting in an actual drop of net revenue of 12.5%. She is from Minnesota. Just sayin'
dfosterf (25-Jul) : Any plans to hold Maureen Smith (CFO) accountable for a 95% drop in investment revenue?
Mucky Tundra (25-Jul) : In your face, HBO!
Mucky Tundra (25-Jul) : @ByRyanWood Mark Murphy: ā€œA great source of pride of mine is that we were never on Hard Knocks.ā€
Mucky Tundra (25-Jul) : *years
Mucky Tundra (25-Jul) : @mattschneidman Mark Murphy says he anticipates ā€œmany Packers gamesā€ being played in Germany, Ireland and/or the U.K. over the next 5-10 yea
dfosterf (25-Jul) : *cafeteria* I have hit my head also, so I sympathize
dfosterf (25-Jul) : Possibly hit his head leaning into the glass protecting the food in the cafateria
dfosterf (25-Jul) : Maybe a low flying drone
dfosterf (25-Jul) : Did Savion Williams run into a goalpost or something?
Mucky Tundra (25-Jul) : also, no bueno when a guy starts getting concussions right off the bat in his career
Zero2Cool (25-Jul) : Concussion is worse. Banks probably vet off day via back booboo claim
Mucky Tundra (25-Jul) : @AndyHermanNFL Jordy Nelson out at camp today. No word if he’s in play for one of the two open roster spots ; )
dfosterf (25-Jul) : Is that better or worse than Banks bad back?
Zero2Cool (25-Jul) : Savion concussion ... not good.
packerfanoutwest (24-Jul) : Aaron Rodgers’s first pass of first team period was picked off
Mucky Tundra (24-Jul) : tbh I didn't hear of his passing
Zero2Cool (24-Jul) : Cosby Show. Malcom Jamal Warner I think is real name
Mucky Tundra (24-Jul) : I was thinking of Ozzy and Hulk
Mucky Tundra (24-Jul) : Who's Theo?
Zero2Cool (24-Jul) : How is Theo alliteration?
Mucky Tundra (24-Jul) : Bad week for people whose names are alliterations
Zero2Cool (24-Jul) : Hulk Hogan gone too.
Zero2Cool (24-Jul) : Oh, it's toe injury
Zero2Cool (24-Jul) : Hope it's not serious. that would stink
dfosterf (24-Jul) : Sounds like an ankle not a knee for Fields
dfosterf (24-Jul) : Ya Flaccp on Browns
Zero2Cool (24-Jul) : Maybe Tyrod Taylor instead
Zero2Cool (24-Jul) : He's on Browns, right?
dfosterf (24-Jul) : They would probably go with Flacco is my guess if Fields out
dfosterf (24-Jul) : Fleece 'em again!
Zero2Cool (24-Jul) : Malik Willis might be someone Jets come after
packerfanoutwest (24-Jul) : Packers introduce 1923-inspired classic uniform, leather-look helmet
Zero2Cool (23-Jul) : Both LB Quay Walker and Rookie DB Micah Robinson have passed their physicals
Zero2Cool (23-Jul) : Happy to see site feels more snappy snappy
Zero2Cool (23-Jul) : No sir. I did not.
dfosterf (23-Jul) : You didn't get free childcare when you were at work?
wpr (23-Jul) : These guys make hundreds of thousands of dollars a year. Pay for their own childcare.
dfosterf (23-Jul) : 2nd issue. Number 1 issue was no gameday childcare. 1 of 3 teams not providing it
Zero2Cool (23-Jul) : Suppose if locker room is main issue, we sitting pretty
wpr (23-Jul) : I thought so Mucky. In those useless player polls GB always rates high overall. Locker is a part of it.
Mucky Tundra (23-Jul) : Wasn't the locker room just updated like 6 or 7 years ago?
Zero2Cool (23-Jul) : I have forum updated on different site. We'll see how this one goes before going to that
Zero2Cool (23-Jul) : Elgton Jenkins has a back injury, is expect to end contract dispute
wpr (23-Jul) : It's funny the PA complained about the locker room. It wasn't that long ago it was top shelf. Things change in a hurry.
wpr (23-Jul) : The site is much more better.
Zero2Cool (23-Jul) : NFLPA report said Packers lockerroom needed upgrade. Whining bout where you change?
Please sign in to use Fan Shout
2025 Packers Schedule
Sunday, Sep 7 @ 3:25 PM
LIONS
Thursday, Sep 11 @ 7:15 PM
COMMANDERS
Sunday, Sep 21 @ 12:00 PM
Browns
Sunday, Sep 28 @ 7:20 PM
Cowboys
Sunday, Oct 12 @ 3:25 PM
BENGALS
Sunday, Oct 19 @ 3:25 PM
Cardinals
Sunday, Oct 26 @ 7:20 PM
Steelers
Sunday, Nov 2 @ 12:00 PM
PANTHERS
Monday, Nov 10 @ 7:15 PM
EAGLES
Sunday, Nov 16 @ 12:00 PM
Giants
Sunday, Nov 23 @ 12:00 PM
VIKINGS
Thursday, Nov 27 @ 12:00 PM
Lions
Sunday, Dec 7 @ 12:00 PM
BEARS
Sunday, Dec 14 @ 3:25 PM
Broncos
Friday, Dec 19 @ 11:00 PM
Bears
Friday, Dec 26 @ 11:00 PM
RAVENS
Saturday, Jan 3 @ 11:00 PM
Vikings
Recent Topics
25-Jul / Around The NFL / Mucky Tundra

25-Jul / Green Bay Packers Talk / Mucky Tundra

25-Jul / Green Bay Packers Talk / TheKanataThrilla

25-Jul / Green Bay Packers Talk / dfosterf

25-Jul / Around The NFL / beast

24-Jul / Green Bay Packers Talk / Martha Careful

24-Jul / Around The NFL / beast

24-Jul / Green Bay Packers Talk / Mucky Tundra

23-Jul / Green Bay Packers Talk / beast

23-Jul / Green Bay Packers Talk / wpr

22-Jul / Random Babble / Zero2Cool

22-Jul / Green Bay Packers Talk / Zero2Cool

22-Jul / Green Bay Packers Talk / Zero2Cool

20-Jul / Green Bay Packers Talk / Mucky Tundra

20-Jul / Green Bay Packers Talk / Mucky Tundra

Headlines
Copyright Ā© 2006 - 2025 PackersHome.comā„¢. All Rights Reserved.