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
    dfosterf (8h) : For the record, I enjoy Beast and Mucky drafts
    Zero2Cool (15h) : Haha
    Mucky Tundra (16h) : No time for talking! Back to work beast!
    beast (17h) : You saw only 4,201 of my mocks? 🥺 I think that means you missed more than half of them 😢
    dfosterf (20h) : Does anyone know what Lambeau field improvements got put on hold? My guess would be for the 2025 draft
    Zero2Cool (22h) : It's like listen, you made 4,201 mocks, no shit.
    Zero2Cool (22h) : Cuz during the draft "I had them mocked there!" as if it's amazing.
    Zero2Cool (22h) : They're fun to do once in awhile. It's people who think they are "content" that annoy me.
    dfosterf (22h) : Against tbd
    dfosterf (22h) : Answer to your question is yes, it's a Thursday, will be the Chiefs aga
    dfosterf (22h) : Luckily for all concerned, I don't post them. I did one, but that was like 25 mocks ago
    Zero2Cool (22h) : NFL 2024 gonna start Sept 5th isn't it???
    Zero2Cool (22h) : Ugh... kids these days!
    dfosterf (22h) : I'm gonna go do some more mock draft hell instead 🤪
    Zero2Cool (23h) : Did we do one of those prediction threads yet for 2024 season?
    dfosterf (23h) : In my city, they are playing the nimby game, in order to keep some railroad tracks vs. 2 professional sports teams and a concert venue.
    dfosterf (23h) : And/Or a city council, of which I haven't seen a good one in a very long time
    dfosterf (23h) : That sounds like a Mayor, not a city.
    buckeyepackfan (26-Mar) : Packers halt scheduled 80mil upgrade of stadium until lease agreement talks are restarted
    Zero2Cool (26-Mar) : City of Green Bay puts Packers' Lambeau Field lease talks on hold
    buckeyepackfan (26-Mar) : Packers 1 of 3 teams to vote no on new kickoff rule.
    Zero2Cool (26-Mar) : Packers sign another Kicker
    dfosterf (26-Mar) : Lengthy explanation at PFF if you click the link
    dfosterf (26-Mar) : Kickoff rules officially changed.ngthy explan
    Zero2Cool (26-Mar) : lol
    Cheesey (26-Mar) : 2009? No thanks! One open heart surgery is enough!
    dfosterf (26-Mar) : Good for you!
    Zero2Cool (26-Mar) : Yes. That's the one.
    dfosterf (26-Mar) : Is that "Lady Dugan" per chance?
    dfosterf (26-Mar) : Crystal?
    dfosterf (26-Mar) : Please refresh my memory
    Zero2Cool (26-Mar) : Alan posts. Crystal back in my life. It's 2009 all over again! Lol
    Mucky Tundra (26-Mar) : BAH GAWD! THAT'S CHEESEYS MUSIC!
    Zero2Cool (25-Mar) : Gutekunst said early stages of Jordan Love contract being discussed.
    Zero2Cool (25-Mar) : Shouldn't be penalized cuz official screwed up
    Zero2Cool (25-Mar) : Yeah, challenge until you are incorrect twice.
    Zero2Cool (25-Mar) : Fining them is the goal, per the people who made the rule anyway.
    dfosterf (25-Mar) : Still waiting on the kickoff rule changes. Did hear yesterday that the touchback proposal will now be the 30 yard line, not the 35
    dfosterf (25-Mar) : Probably speed of game issues with your proposal
    dfosterf (25-Mar) : Hopefully the refs don't get in the habit of throwing flags on this
    beast (25-Mar) : I think when it comes to Challenges should get two strikes, so unlimited challenges as long as they keep winning them, but 2 wrong then done
    dfosterf (25-Mar) : Still subject to the fines etc
    dfosterf (25-Mar) : Yes, I should have been more specific. Also, they are now saying it would be a 15 yard penalty. That makes more sense .
    beast (25-Mar) : Simply fined in the week to follow
    beast (25-Mar) : I agree with one NFL official, it'll probably be like some of the helmets hits, not really called by the refs on the field but simply fined
    Zero2Cool (25-Mar) : Hip drop is not. Super confusing. Referees job is harder
    Zero2Cool (25-Mar) : Swivel hip drop is banned
    dfosterf (25-Mar) : The hip drop enforcement will be in the form of fines, etc. Not flags
    dfosterf (25-Mar) : A major foul will be enforced on the offense if there are offsetting penalties in a change of possession situation
    dfosterf (25-Mar) : Teams will receive a 3rd challenge if 1 was successful. Previously, it took 2
    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
    9h / Green Bay Packers Talk / dfosterf

    9h / Green Bay Packers Talk / bboystyle

    9h / Green Bay Packers Talk / bboystyle

    16h / Green Bay Packers Talk / Mucky Tundra

    20h / Random Babble / Zero2Cool

    27-Mar / Green Bay Packers Talk / beast

    26-Mar / Green Bay Packers Talk / beast

    26-Mar / Green Bay Packers Talk / beast

    26-Mar / Green Bay Packers Talk / bboystyle

    25-Mar / Green Bay Packers Talk / Zero2Cool

    25-Mar / Green Bay Packers Talk / Zero2Cool

    24-Mar / Around The NFL / dhazer

    24-Mar / Green Bay Packers Talk / beast

    24-Mar / Green Bay Packers Talk / beast

    22-Mar / Green Bay Packers Talk / beast

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