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 (20h) : NFL teams were notified today that the 2025 salary cap has been set at $279,200,000 per club.
Zero2Cool (20h) : sssllllooooow
Martha Careful (20h) : is it just me, or has the website been slow the last couple of days?
buckeyepackfan (26-Feb) : Damnit 2026 2nd rnd pick!
buckeyepackfan (26-Feb) : Packers get Myles Garret and Browns 2926 2nd rnd pick.
buckeyepackfan (26-Feb) : Browns get Jaire, + Packers #1 2025 pick and 2026 3rd rnd pick.
beast (26-Feb) : Rams trying to trade Stafford and Kupp, then signing Rodgers and Adams? Just speculation, but interesting
Zero2Cool (26-Feb) : Packers shopping Jaire Alexander per Ian Rapoport
Zero2Cool (25-Feb) : Gutekunst and Jaire Alexander’s agent, John Thornton, are meeting this week in Indianapolis to determine the future of the Packers’ 28-year-
Zero2Cool (25-Feb) : Gutekunst says Mark Murphy told him he can trade their first-round pick despite the draft being in Green Bay.
Zero2Cool (24-Feb) : Packers. 🤦
Zero2Cool (24-Feb) : One team.
Zero2Cool (24-Feb) : One team petition NFL to ban Brotherly Shove.
beast (23-Feb) : Seems like he was just pissed because he was no longer the starter
beast (23-Feb) : Campbell is right, he's rich and he doesn't have to explain sh!t... but that attitude gives teams reasons to never sign him again.
dfosterf (22-Feb) : I have some doubt about all that
dfosterf (22-Feb) : I read De'Vondre Campbell's tweet this morning (via the New York Post) Florio says that if he invested his earnings wisely, he will be good
beast (20-Feb) : I haven't followed, but I believe he's good when healthy, just hasn't been able to stay healthy.
dfosterf (20-Feb) : Hasn"t Bosa missed more games than he has played in the last 3 years?
Mucky Tundra (19-Feb) : He hasn't been too bad when healthy but I don't feel like I ever heard much about when he is
Zero2Cool (19-Feb) : Felt like he was more interested in his body, than football. He flashed more than I expected
Zero2Cool (19-Feb) : When he was coming out, I thought he'd be flash in pan.
Mucky Tundra (19-Feb) : Joey seems so forgettable compared to his brother for some reason
Zero2Cool (19-Feb) : NFL informed teams today that the 2025 salary cap will be roughly $277.5M-$281.5M
Zero2Cool (19-Feb) : Los Angeles Chargers are likely to release DE Joey Bosa this off-season as a cap casualty, per league source.
Zero2Cool (18-Feb) : If the exploit is not fixed, we'll see tons of "50 top free agents, 50 perfect NFL team fits: We picked where each should sign in March" lo
Zero2Cool (18-Feb) : Issue should be solved, database cleaned and held strong working / meeting. Boom!
Zero2Cool (18-Feb) : It should be halted now.
Mucky Tundra (18-Feb) : usually spambots are trying to get traffic to shady websites filled with spyware; the two links being spammed were to the Packers website
Mucky Tundra (18-Feb) : you know when you put it that way combined with the links it was spamming (to the official Packers website)
Zero2Cool (18-Feb) : Yep. You can do that with holding down ENTER on a command in Console of browser
Mucky Tundra (18-Feb) : even with the rapid fire posts?
Zero2Cool (18-Feb) : I'm not certain it's a bot.
Mucky Tundra (18-Feb) : I've got to go to work soon which is a pity because I'm enthralled by this battle between the bot and Zero
Zero2Cool (18-Feb) : Yeah, I see what that did. Kind of funny.
Mucky Tundra (18-Feb) : now it's a link to Wes Hodkiezwicz mailbag
Mucky Tundra (18-Feb) : Now they're back with another topic
Mucky Tundra (18-Feb) : oh lol
Zero2Cool (18-Feb) : I have a script that purges them now.
Zero2Cool (18-Feb) : 118 Topics with Message.
Mucky Tundra (18-Feb) : what's 118 (besides a number)?
Zero2Cool (18-Feb) : They got 118 slapped in there.
Mucky Tundra (18-Feb) : that's why it confused the hell out of me
Zero2Cool (18-Feb) : Yeah, but this is taking a headline and slapping it into the Packers Talk
Mucky Tundra (18-Feb) : Wasnt there a time guests could post in the help forum?
Zero2Cool (18-Feb) : lol good question, kind of impressed!
Mucky Tundra (18-Feb) : So how is a guest posting?
Mucky Tundra (18-Feb) : Tell them its an emergency
Zero2Cool (18-Feb) : Working. Meetings.
Mucky Tundra (18-Feb) : Lots of fun; the spam goes back 4 or 5 pages by this point
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
50m / Green Bay Packers Talk / Zero2Cool

2h / Around The NFL / Zero2Cool

19h / Green Bay Packers Talk / Zero2Cool

21h / Green Bay Packers Talk / Zero2Cool

27-Feb / Green Bay Packers Talk / wpr

26-Feb / Green Bay Packers Talk / beast

26-Feb / Green Bay Packers Talk / buckeyepackfan

24-Feb / Green Bay Packers Talk / bboystyle

24-Feb / Green Bay Packers Talk / Zero2Cool

23-Feb / Green Bay Packers Talk / beast

19-Feb / Green Bay Packers Talk / Zero2Cool

19-Feb / Green Bay Packers Talk / MintBaconDrivel

18-Feb / Green Bay Packers Talk / Zero2Cool

18-Feb / Green Bay Packers Talk / Zero2Cool

18-Feb / Green Bay Packers Talk / Zero2Cool

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