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 (14-Apr) : Packers DT Kenny Clark: New defensive coordinator Jeff Hafley will 'allow us to be way more disruptive'
    Zero2Cool (12-Apr) : Saints have agreed to terms on a contract with former Packers wide receiver Equanimeous St. Brown.
    beast (12-Apr) : No, but of it's for legislation, then half of the country will find it evil, not good, whatever it says....
    Mucky Tundra (12-Apr) : Draft is still 2 weeks away. UGH
    dhazer (11-Apr) : Does anyone know of a good AI generator to create letters of Support for legislation?
    Zero2Cool (11-Apr) : Gordon "Red" Batty retires as equipment manager
    Zero2Cool (10-Apr) : Sounds like that's pretty certain now.
    Zero2Cool (10-Apr) : Packers "at" Eagles in Brazil. Week One
    dfosterf (10-Apr) : Va' Fazer As Malas Va' !
    Zero2Cool (9-Apr) : Mark Murphy tipping us off?
    Zero2Cool (9-Apr) : “We’re either the first- or second-most popular team in Brazil.”
    Zero2Cool (9-Apr) : Christian Watson got married. Wife better be careful with those hamstrings!! 😂😂
    dfosterf (9-Apr) : Those poor bastards
    Zero2Cool (8-Apr) : Falcons have signed former Packers CB Kevin King, who has been out of football since 2021.
    dfosterf (8-Apr) : Collectively, we need to spend more time in what we have, when analyzing ostendible needs and historical proclivities
    dfosterf (8-Apr) : I say he is better than so many of these draft picks
    dfosterf (8-Apr) : Question of the week for me: Has anyone besides me done any deep dive into the potential of Alex McGough, our 3rd string qb?
    Zero2Cool (8-Apr) : Or in Tunsil's case, something gets released day of draft or day before lol
    Zero2Cool (8-Apr) : Seems every year someone does something pre-draft.
    dfosterf (8-Apr) : Falling down drunk. The draft board
    dfosterf (8-Apr) : Allright! Potential character guy/f#×k up pickup in D'Vondre Sweat!
    Zero2Cool (7-Apr) : Go Badgers!!!
    Martha Careful (6-Apr) : Go Boilermakers!!!
    Martha Careful (5-Apr) : Diggs has not stepped up in the playoffs and has a high cost
    beast (5-Apr) : Probably not going to let Diggs walk away unless he's horrible... but according to reports he also might not be as good as he used to be.
    beast (5-Apr) : The 25th pick in the draft has been an offensive player since 2017, 2 TE, 2 WR, 1 RB, 1 OC
    Mucky Tundra (5-Apr) : Odd, why give up a 2025 2nd Rounder for him if you're just gonna let him walk?
    Zero2Cool (4-Apr) : Texans to let Diggs be free agent in '25
    buckeyepackfan (4-Apr) : 49r's aign RB Patrick Taylor.
    Martha Careful (4-Apr) : Reversion to the mean would indicate we will keep it
    Zero2Cool (4-Apr) : It's also been utilized in a trade in 14 of the past 20 years
    Zero2Cool (4-Apr) : The 25th pick in the draft hasn't been made by it's original holder since 2016.
    Mucky Tundra (4-Apr) : Gotta imagine that Green Bay vs Houston will be a primetime game this upcoming season
    Zero2Cool (3-Apr) : No. Kill QB. No worries. 😁
    Mucky Tundra (3-Apr) : Diggs, Collins, Dell and Schultz is gonna be tough to cover
    Zero2Cool (3-Apr) : Stefon Diggs' trade will not be processed as a post-June 1 designation, so that is just over $31 million in dead cap this year.
    Zero2Cool (3-Apr) : Bills trading WR Stefon Diggs to the Texans in exchange for a 2025 2nd-round pick. (via @rapsheet)
    beast (3-Apr) : Using Patterson as RB and RB/WR tweener... so I think they also signed Patterson as a 3rd down RB, not just a kick returner as articles are
    beast (3-Apr) : I think PFT missed the real Steelers/Patterson connection, Steelers new OC Arthur Smith has been Patterson's head coach the last 3 years
    wpr (2-Apr) : It has Martha. I was stunned when I was in HS to learn Iowa was still playing half court BB in the 70's.
    Martha Careful (2-Apr) : Caitlin Clark, Angel Reese...women's sports has come a long way. GREAT TO SEE!!
    Martha Careful (31-Mar) : Happy Easter everyone. I hope you all have a great day.
    dfosterf (28-Mar) : Maybe
    Mucky Tundra (28-Mar) : Yes
    Zero2Cool (28-Mar) : No.
    Mucky Tundra (28-Mar) : End of a Degu-era
    dhazer (28-Mar) : Steelers sign Patterson because of new kickoff rule interesting
    Zero2Cool (28-Mar) : Former #Packers TE Josiah Deguara is signing a 1-year deal with the Jaguars, per source.
    Zero2Cool (28-Mar) : They do not do it for "content sake".
    dfosterf (28-Mar) : For the record, I enjoy Beast and Mucky drafts
    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
    5h / Green Bay Packers Talk / Mucky Tundra

    12h / Random Babble / Martha Careful

    15h / Green Bay Packers Talk / dfosterf

    18h / Green Bay Packers Talk / dfosterf

    22h / Green Bay Packers Talk / beast

    12-Apr / Random Babble / Nonstopdrivel

    12-Apr / Green Bay Packers Talk / Martha Careful

    11-Apr / Green Bay Packers Talk / Zero2Cool

    10-Apr / Green Bay Packers Talk / dfosterf

    8-Apr / Green Bay Packers Talk / Zero2Cool

    5-Apr / Green Bay Packers Talk / Martha Careful

    5-Apr / Green Bay Packers Talk / bboystyle

    4-Apr / Green Bay Packers Talk / Zero2Cool

    4-Apr / Green Bay Packers Talk / buckeyepackfan

    4-Apr / Green Bay Packers Talk / Mucky Tundra

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