Zero2Cool
14 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
14 years ago
I have no idea what you are talking about, but thanks for keeping this site running!
djcubez
14 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
14 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
14 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
14 years ago

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

"IronMan" wrote:

Porforis
14 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
14 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
14 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
14 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
Users browsing this topic
Fan Shout
Zero2Cool (5m) : Thanks Mucky and whomever created topcos for each pick!
Zero2Cool (5m) : Insane about Kingsley
dfosterf (2h) : Putring it here so Mucky sees it. He was our guy!
dfosterf (2h) : Bowden long snapper Wisconsin. Consensus best LS in college.
dfosterf (2h) : We got Peter Bowde
dfosterf (3h) : I personally interpret that as a partial tear that can be recovered from with rehab
dfosterf (3h) : MLF said Kingsley Enagbare did NOT tear his ACL and did NOT require surgery, and that he is "looking good" for the 2024 season!
beast (14h) : T.O. son signs with the 49ers
Mucky Tundra (15h) : damn those vikings
beast (16h) : UDFA Vikings sign TE – Trey Knox, South Carolina
beast (16h) : Kitchen was all high from Miami, he was more lucky than talented in 2022 and it showed in 2023
beast (16h) : Reportedly Packers have UDFAs Jennings and Jones
beast (16h) : OL – Donovan Jennings, USF OT – Trente Jones, Michigan
TheKanataThrilla (16h) : Interesting draft. A bit shocked that we didn't select an early CB. Definitely have Safety help. Pretty happy overall.
dhazer (23h) : wow the last 2 picks are really stupid and probably will be special teams players Top 10 draft pick next year book it
TheKanataThrilla (23h) : I think he ended up with a terrible RAS score
dhazer (23h) : Anyone know what went on with Kitchens from Florida? At 1 point he was to be the Packers 1st round and he is way down the board now
Martha Careful (27-Apr) : Z, could you please combine my thread with yours please. I obviously did not see it when I Created it
Martha Careful (26-Apr) : Re: 'Kool-Aid' McKinstry. Other than Icky Woods, has there ever been a good NFLer with a childish nickname?
Martha Careful (26-Apr) : Packers looking to trade up
Martha Careful (26-Apr) : Flag?
Martha Careful (26-Apr) : Sag?
Nonstopdrivel (26-Apr) : It rhymes with "bag."
beast (26-Apr) : Family? That's Deadpool's F word
Nonstopdrivel (26-Apr) : Not THAT f-word.
Zero2Cool (26-Apr) : fuck
beast (25-Apr) : 49ers are Cap Tight
beast (25-Apr) : Fuck
Mucky Tundra (25-Apr) : Kanata, I will be when I'm on my lunch later
TheKanataThrilla (25-Apr) : Love you NSD
Nonstopdrivel (25-Apr) : Huh. I guess the F-word is censored in this fan shout.
Nonstopdrivel (25-Apr) : Anyone who doesn't hang out in the chat probably smokes pole.
TheKanataThrilla (25-Apr) : GoPackGo Thinking CB is the pick tonight
TheKanataThrilla (25-Apr) : Anyone hanging out in the chat tonight?
Zero2Cool (25-Apr) : whoa...49ers have had trade conversations about both Deebo Samuel and Brandon Aiyuk
Zero2Cool (25-Apr) : I hope they take a Punter at 9th overall. Be bold!
Mucky Tundra (25-Apr) : I may end up eating those words but I think they need a lot more talent then their 4 picks can provide
Mucky Tundra (25-Apr) : I really hope they stand pat and Draft a WR
Mucky Tundra (25-Apr) : @DMRussini
Mucky Tundra (25-Apr) : The Chicago Bears are very open for business at 9 and telling teams they are ready to move for the right price, per source
buckeyepackfan (24-Apr) : Lions extend Penei Soul 4yrs - 112mil
buckeyepackfan (24-Apr) : Lions extend St. Brown 4 years 120mil and
Mucky Tundra (24-Apr) : Now look, trading up to 13 to take a TE might not seem like a good idea later but it will be later!
dfosterf (24-Apr) : (Your trade up mock post)
dfosterf (24-Apr) : Mucky- The only thing fun to watch would be me flipping the f out if Gute goes up to 13 and grabs Brock Bowers, lol
beast (24-Apr) : DT Byron Murphy II, Texas... whom some believe is the next Aaron Donald (or the closest thing to Donald)
Zero2Cool (24-Apr) : What? And who?
Mucky Tundra (24-Apr) : *sad Mucky noises*
Mucky Tundra (24-Apr) : @JoeJHoyt Murphy said he’s been told he won’t slide past pick No. 16.
wpr (23-Apr) : Just about time to watch Sonny Weaver stick it to the seahags. I never get tired of it.
Please sign in to use Fan Shout
2023 Packers Schedule
Sunday, Sep 10 @ 3:25 PM
Bears
Sunday, Sep 17 @ 12:00 PM
Falcons
Sunday, Sep 24 @ 12:00 PM
SAINTS
Thursday, Sep 28 @ 7:15 PM
LIONS
Monday, Oct 9 @ 7:15 PM
Raiders
Sunday, Oct 22 @ 3:25 PM
Broncos
Sunday, Oct 29 @ 12:00 PM
VIKINGS
Sunday, Nov 5 @ 12:00 PM
RAMS
Sunday, Nov 12 @ 12:00 PM
Steelers
Sunday, Nov 19 @ 12:00 PM
CHARGERS
Thursday, Nov 23 @ 11:30 AM
Lions
Sunday, Dec 3 @ 7:20 PM
CHIEFS
Monday, Dec 11 @ 7:15 PM
Giants
Sunday, Dec 17 @ 12:00 PM
BUCCANEERS
Sunday, Dec 24 @ 12:00 PM
Panthers
Sunday, Dec 31 @ 7:20 PM
Vikings
Sunday, Jan 7 @ 3:25 PM
BEARS
Sunday, Jan 14 @ 3:30 PM
Cowboys
Saturday, Jan 20 @ 7:15 PM
49ers
Recent Topics
1h / Green Bay Packers Talk / earthquake

4h / Green Bay Packers Talk / bboystyle

10h / Green Bay Packers Talk / beast

10h / Green Bay Packers Talk / beast

11h / Green Bay Packers Talk / Mucky Tundra

11h / Green Bay Packers Talk / beast

11h / Green Bay Packers Talk / Mucky Tundra

11h / Green Bay Packers Talk / beast

11h / Green Bay Packers Talk / beast

11h / Green Bay Packers Talk / beast

12h / Green Bay Packers Talk / beast

13h / Green Bay Packers Talk / earthquake

21h / Green Bay Packers Talk / beast

27-Apr / Green Bay Packers Talk / Mucky Tundra

27-Apr / Green Bay Packers Talk / Martha Careful

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