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 (2-Apr) : WR who said he'd break Xavier Worthy 40 time...and ran slower than you
Mucky Tundra (2-Apr) : Who?
Zero2Cool (2-Apr) : Texas’ WR Isaiah Bond is scheduled to visit the Bills, Browns, Chiefs, Falcons, Packers and Titans starting next week.
Zero2Cool (2-Apr) : Spotting ball isn't changing, only measuring distance is, Which wasn't the issue.
Zero2Cool (2-Apr) : The spotting of the ball IS the issue. Not the chain gang.
Mucky Tundra (2-Apr) : Will there be a tracker on the ball or something?
Zero2Cool (1-Apr) : uh oh
Martha Careful (1-Apr) : Too bad camera's can't spot the ball as well.
Mucky Tundra (1-Apr) : So will the chain gang be gone completely or will they still be around as a backup or whatever?
Zero2Cool (1-Apr) : The method for measuring first downs in the NFL will switch from chain gangs to camera-based technology in 2025, the league announced.
Martha Careful (1-Apr) : A big step in the right direction. Just put in the college system is very very good.
Zero2Cool (1-Apr) : NFL has passed a rule that allows both teams to possess the ball in OT during the regular season
Zero2Cool (1-Apr) : Touchbacks on kickoffs will now bring the ball to the 35-yard line.
beast (31-Mar) : It might of gotten more popular recently, but braiding hair (even men) in certain cultures goes back for centuries.
Martha Careful (30-Mar) : Is men braiding their hair a new style thing? Watching the NCAA men's tournament many players have done
Zero2Cool (29-Mar) : Ha. Well, it'd be nice for folks to reset their own password. Via validated email 😏
beast (29-Mar) : Monopoly was supposed to be an educational game, that show how evil capitalism was and how we should avoid it
beast (29-Mar) : Lol, I was thinking username would be better, as then I wouldn't have to keep an email up to date lol 😂
beast (29-Mar) : Zero2Cool (25-Mar) : I was thinking email because I think it'll make folks keep it up todate lol
wpr (29-Mar) : sure is
Zero2Cool (29-Mar) : Monopoly is a rip off of The Landlord's Game
wpr (27-Mar) : 28 days until the draft
earthquake (27-Mar) : Which seemed strange to my 9 year old self, that you could be a fan for a team other than the one you play for
earthquake (27-Mar) : Nothing eventful happened, other than it being clear that he was a bengals fan
earthquake (27-Mar) : And we went and hung out with him one afternoon, I must have been 9 or so
earthquake (27-Mar) : That’s wild, when I was a kid my friend lived in the same apartment complex in De Pere
Mucky Tundra (27-Mar) : Only career highspot was a 200 yard rushing game while playing for the Cardinals
Mucky Tundra (27-Mar) : He is a former Packer. Drafted out of Northern Illinois. Didn't do much in GB.
dfosterf (26-Mar) : Despicable
Zero2Cool (26-Mar) : Former NFL. I think Packers too
Zero2Cool (26-Mar) : NFL RB Leshon Johnson has been charged in a massive dog fighting operation, with the FBI seizing over 190 Pit Bulls
Mucky Tundra (26-Mar) : Some real irony of a QB as short as Wilson playing for the Giants
Mucky Tundra (26-Mar) : Giants country, let's be the tall beings of lore!
Mucky Tundra (26-Mar) : Russell Wilson signs with the Giants.
Zero2Cool (25-Mar) : I was thinking email because I think it'll make folks keep it up todate lol
wpr (25-Mar) : I don't think there is a significant difference. I use a user name for many. Others email.
Martha Careful (25-Mar) : email
Zero2Cool (25-Mar) : would it be better to use EMAIL or USERNAME to log into a site?
wpr (25-Mar) : Thanks Zero
Zero2Cool (24-Mar) : New forum has the ability to Thank a post now.
beast (24-Mar) : And the only time they have won the Championship in an even year, was the first time they did, in 2006.
beast (24-Mar) : Since 2007, there have been 10 odd numbered years, Wisconsin Women have won the Championship in 7 of those 10 odd numbered years.
buckeyepackfan (24-Mar) : Congratulations Lady Badger Hockey Team. NATIONAL CHAMPIONS!!
Zero2Cool (23-Mar) : I don't think it's completed yet. it was just announced last month, right?
dhazer (23-Mar) : did netflix ever release the Packers documentary
Zero2Cool (21-Mar) : And it is glorious!
beast (21-Mar) : Unsigned FA QB Rodgers is supposedly in the Steelers building
Martha Careful (19-Mar) : But I don't own a car! So can I still use it in my apartment?
Zero2Cool (19-Mar) : btw, new site auto updates
Zero2Cool (19-Mar) : Woohoo!
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
2-Apr / Green Bay Packers Talk / Zero2Cool

2-Apr / Green Bay Packers Talk / bboystyle

1-Apr / Green Bay Packers Talk / Mucky Tundra

1-Apr / Green Bay Packers Talk / wpr

31-Mar / Green Bay Packers Talk / Zero2Cool

30-Mar / Green Bay Packers Talk / Zero2Cool

29-Mar / Random Babble / wpr

28-Mar / Feedback, Suggestions and Issues / dfosterf

28-Mar / Random Babble / Martha Careful

26-Mar / Random Babble / Mucky Tundra

25-Mar / Random Babble / Martha Careful

24-Mar / Random Babble / packerfanoutwest

24-Mar / Random Babble / Zero2Cool

21-Mar / Green Bay Packers Talk / Zero2Cool

19-Mar / Green Bay Packers Talk / Zero2Cool

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