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 (16h) : Eagles WR DeVonta Smith will be a DNP in todayā€™s practice. Heā€™s dealing with back tightness. But the expectation is that heā€™ll play Sunday.
Zero2Cool (16h) : Jalen Hurts has cleared the concussion protocol. Heā€™s playing Sunday.
Zero2Cool (17h) : š•avier McKinney First Team All-Pro
Zero2Cool (21h) : NFL moves Vikings-Rams playoff tilt to Arizona due to fires
Zero2Cool (21h) : Rams lose home field advantage for Monday game.
Mucky Tundra (9-Jan) : Notre Lame=Notre Dame, Luckeyes=Ohio State, Pedo St=Penn St
Zero2Cool (9-Jan) : ... It clearly was not what we were supposed to be in, certainly."
Zero2Cool (9-Jan) : Hafley says 3rd and 11 call there was a miscommunication.
Zero2Cool (9-Jan) : The only team I know is Texas from that. Who are the other three?
Mucky Tundra (9-Jan) : Notre Lame vs Pedo St tonight and the Luckeyes vs Texas tomorrow
Mucky Tundra (9-Jan) : Stud
Zero2Cool (9-Jan) : E. Cooper. Rookie of Month. Defense.
Mucky Tundra (8-Jan) : @AaronNagler Ā· 2m Both Jordan Love and Malik Willis were Limited participants at Packers practice today.
Zero2Cool (8-Jan) : Johnson didn't make it until 2020. Ring 2023. šŸ¤· Personally, he should have been in years prior to Hall.
Zero2Cool (8-Jan) : HUMP DAY
beast (8-Jan) : Guys that have a good shot at making the NFL Hall of Fame usually get into their teams pretty fast
beast (8-Jan) : Yeah, but is Kampman and the others in the NFL Hall of Fame?
Zero2Cool (8-Jan) : Johnson was Hall of Fame, 2020. Should haev been in Ring a year later, not three years.
Zero2Cool (8-Jan) : I could be wrong there though
Zero2Cool (8-Jan) : Guys like Kampman, Tim Harris, Al Harris, etc all over 15 years. Hall of Fame is 5 year wait
Zero2Cool (8-Jan) : I guess I see players in Packers Hall come way later
beast (8-Jan) : Yeah, usually teams hall of fames are a much lower bar than the NFL
Zero2Cool (8-Jan) : is it uncommon for Hall before Ring?
Zero2Cool (8-Jan) : S Xavier McKinney named first-team All-Pro by NFLPA
beast (8-Jan) : I missed it, sorry, but he got into the NFL Hall of Fame years before that
Zero2Cool (8-Jan) : Jones took his sweet ole time!
Zero2Cool (8-Jan) : Yeah, he's in the ring of honor, just saw video and his name is up there
Zero2Cool (8-Jan) : Didn't they have a thing in 2023 for Jimmy's ring of honor? I swear I saw it
beast (8-Jan) : Though if they're legitimately trying to re-sign MM, then it makes sense.
beast (8-Jan) : Jerry Jones still hasn't put Jimmy Johnson in the Ring of Honor, but he's in the NFL's Hall of Fame, Jones is petty
Mucky Tundra (8-Jan) : Unless the Cowboys are planning an extension, seems kinda petty
beast (8-Jan) : Cowboys denied Bears request
Mucky Tundra (6-Jan) : From what I'm reading, MM is under contract through the 14th of January; after that he's free game
Zero2Cool (6-Jan) : McCarthy let go or not extended??
Mucky Tundra (6-Jan) : Chicago Bears have asked the Dallas Cowboys permission to interview Mike McCarthy for head coaching vacancy
Zero2Cool (6-Jan) : The winners page that is
Zero2Cool (6-Jan) : I was not hoping for that. It messes up the page lol
beast (6-Jan) : Thank you, and I was really opening we were going to get 4 or more tied for the top 3.
beast (6-Jan) : Thank you, and I was really opening we were going to get 4 or more tied for the top 3.
beast (6-Jan) : Thank you, and I was really opening we were going to get 4 or more tied for the top 3
Zero2Cool (6-Jan) : congrats beast on 2024 !
Zero2Cool (6-Jan) : congrats porky on winning 2023 pick'em! (oops sorry)
Zero2Cool (6-Jan) : Packers have $60M+ of 2025 cap space on paper TODAY.
Mucky Tundra (6-Jan) : Missed FG into a Lions TD; that'll do pig, that'll do
Mucky Tundra (6-Jan) : That might be it for the Vikings
Mucky Tundra (6-Jan) : Oh so the refs do know what intentional grounding is
Mucky Tundra (6-Jan) : what the hell was that Goff?! Not much pressure and he just air mails it to Harrison
Mucky Tundra (6-Jan) : They really need to to get rid of the auto first down for illegal contact
Martha Careful (6-Jan) : watching the Vikings and Lions it's understandable why they swept the Packers. So much better product
Mucky Tundra (6-Jan) : Even when GB got pressure he was throwing darts; vs no pressure on that last pass he just air mails an open guy
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
Recent Topics
6h / Green Bay Packers Talk / Martha Careful

6h / Green Bay Packers Talk / Martha Careful

13h / Green Bay Packers Talk / Zero2Cool

17h / Green Bay Packers Talk / Zero2Cool

9-Jan / Around The NFL / beast

9-Jan / Green Bay Packers Talk / Zero2Cool

9-Jan / Green Bay Packers Talk / bboystyle

8-Jan / Around The NFL / beast

7-Jan / Fantasy Sports Talk / wpr

7-Jan / Green Bay Packers Talk / Zero2Cool

7-Jan / Fantasy Sports Talk / Zero2Cool

6-Jan / Green Bay Packers Talk / Martha Careful

6-Jan / Green Bay Packers Talk / Martha Careful

6-Jan / Green Bay Packers Talk / Martha Careful

6-Jan / Green Bay Packers Talk / beast

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