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)
reed
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 (41m) : If you wanna post about the Super Bowl, please, by all means, open a topic. They are free this month! 😁
Zero2Cool (41m) : There doesn't need to be a topic. There's a playoff prediction thread.
packerfanoutwest (49m) : and there no SB contest over in the other Packer forum, either
buckeyepackfan (1h) : #2Officially Retires!
beast (1h) : Probably no SB topic as people are wore out talking about the Chiefs, Refs and Eagles
Zero2Cool (1h) : Packers reportedly have their new LB coach, promoting Sean Duggan to that role
Zero2Cool (5h) : WR Cooper Kupp is being traded.
packerfanoutwest (17h) : why is there no SB Prediction topic?
Zero2Cool (21h) : Anthony Perkins spent 2024 as a defensive quality-control coach with the Packers.
Zero2Cool (21h) : Packers lose another assistant.
Zero2Cool (3-Feb) : Defensive Player of the Year and Browns star Myles Garrett has requested a trade.
Zero2Cool (3-Feb) : deleted all my browser history and autofill and passwords. gonna be fun!
packerfanoutwest (3-Feb) : too funny
packerfanoutwest (3-Feb) : Lions QB Jared Goff was the offensive MVP
packerfanoutwest (3-Feb) : for the Pro Bowl, which is flag football
Zero2Cool (2-Feb) : Rather, the murder WAS covered up to prevent ...
Zero2Cool (2-Feb) : JFK murder was a cover-up to prevent war with Cuba/Russia.
Martha Careful (1-Feb) : I have always admired the pluck of the man
Zero2Cool (1-Feb) : I remember thinking he was going to be something good.
Mucky Tundra (1-Feb) : The Dualing Banjo!
Zero2Cool (31-Jan) : Jets have named Chris Banjo as their special teams coordinator, Former Packers player
Zero2Cool (31-Jan) : Jaguars have hired Anthony Campanile as their DC. We lose coach
Zero2Cool (30-Jan) : QB coach Sean Mannion
Zero2Cool (30-Jan) : DL Coach DeMarcus Covington
dfosterf (30-Jan) : from ft Belvoir, Quantico and points south. Somber reminder of this tragedy at Reagan Nat Airport
dfosterf (30-Jan) : So eerily quiet here in Alexandria. I live in the flight path of commercial craft coming from the south and west, plus the military craft
dfosterf (30-Jan) : So eeri
Mucky Tundra (30-Jan) : Now that's a thought, maybe they're looking at the college ranks? Maybe not head coaches but DC/assistant DCs with league experience?
beast (30-Jan) : College Coaches wouldn't want that publicly, as it would hurt recruiting and they might not get the job.
beast (30-Jan) : I thought they were supposed to publicly announce them, at least the NFL ones. Hafley was from college, so I believe different rules.
Mucky Tundra (30-Jan) : Who knows who they're interviewing? I mean, nobody knew about Hafley and then out of nowhere he was hired
beast (30-Jan) : I wonder what's taking so long with hiring a DL coach, 2 of the 3 known to interview have already been hired elsewhere.
Zero2Cool (27-Jan) : Packers coach Matt LaFleur hires Luke Getsy as senior assistant, extends Rich Bisaccia's deal
Zero2Cool (27-Jan) : Chiefs again huh? I guess another Super Bowl I'll be finding something else to do.
Mucky Tundra (27-Jan) : Chiefs Eagles...again...sigh
dfosterf (27-Jan) : Happy Birthday Dave!
Mucky Tundra (27-Jan) : happy birthday dhazer
TheKanataThrilla (26-Jan) : Exactly buck...Washington came up with the ball. It is just a shitty coincidence one week later
buckeyepackfan (26-Jan) : I forgot, they corrected the call a week later. Lol btw HAPPY BIRTHDAY dhazer!
buckeyepackfan (26-Jan) : That brings up the question, why wasn't Nixon down by contact? I think that was the point Kanata was making.
buckeyepackfan (26-Jan) : Turnovers rule, win the turnover battle, win the game.
packerfanoutwest (26-Jan) : well, he was
TheKanataThrilla (26-Jan) : Eagles down by contact on the fumble....fuck you NFL
Mucky Tundra (26-Jan) : I think this games over
beast (26-Jan) : Eagles sure get a lot of fumbles on kickoffs
Mucky Tundra (26-Jan) : This game looks too big for Washington
packerfanoutwest (26-Jan) : that being said, The Ravens are the Browns
packerfanoutwest (26-Jan) : Browns, Dolphins have longest AFC Championship droughts
packerfanoutwest (26-Jan) : As of today, Cowboys have longest NFC Championship drought,
beast (26-Jan) : Someone pointed out, with Raiders hiring Carroll, the division games between Carroll and Jim Harbaugh are back on (who can whine more games)
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
Sunday, Jan 5 @ 12:00 PM
BEARS
Sunday, Jan 12 @ 3:30 PM
Eagles
Recent Topics
1h / Green Bay Packers Talk / beast

2h / Green Bay Packers Talk / Martha Careful

3h / Green Bay Packers Talk / beast

4h / Green Bay Packers Talk / Zero2Cool

14h / Green Bay Packers Talk / earthquake

15h / Green Bay Packers Talk / earthquake

1-Feb / Green Bay Packers Talk / Martha Careful

1-Feb / Green Bay Packers Talk / wpr

29-Jan / Green Bay Packers Talk / Mucky Tundra

27-Jan / Green Bay Packers Talk / beast

25-Jan / Green Bay Packers Talk / beast

25-Jan / Green Bay Packers Talk / Martha Careful

25-Jan / Random Babble / Martha Careful

20-Jan / Green Bay Packers Talk / Martha Careful

20-Jan / Green Bay Packers Talk / bboystyle

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