Green Bay Packers Forum

Welcome to your Green Bay Packers Online Community!

Since 2006, PackersHome has been providing a unique experience for fans.
Your participation is greatly anticipated!
Login or Register.
10 Pages123>»
Options
Go to last post Go to first unread
Offline Zero2Cool  
#1 Posted : Tuesday, September 8, 2009 12:27:07 AM(UTC)
Rank: Premier Member

Yahoo! NCAA March Madness - Gold: 2015Yahoo! Fantasy Football - Gold: 2009FleaFlicker Fantasy Football - Silver: 2010Yahoo! NCAA March Madness - Silver: 2011ESPN NCAA March Madness - Bronze: 2010Yahoo! NCAA March Madness - Bronze: 2013

United States
Joined: 10/13/2006(UTC)
Location: Green Bay, WI
Applause Given: 2,385
Applause Received: 3,733
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
Offline IronMan  
#2 Posted : Tuesday, September 8, 2009 1:04:32 AM(UTC)
Rank: Veteran Member

ESPN NCAA March Madness - Gold: 2010

Joined: 8/7/2008(UTC)
Applause Given: 161
Applause Received: 138
I have no idea what you are talking about, but thanks for keeping this site running!
Offline djcubez  
#3 Posted : Tuesday, September 8, 2009 1:34:41 AM(UTC)
Rank: Senior Member

FleaFlicker Fantasy Football - Gold: 2014

Joined: 8/7/2008(UTC)
Location: Madison
Applause Given: 11
Applause Received: 17
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":

Code:
<!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>
Offline Zero2Cool  
#4 Posted : Tuesday, September 8, 2009 2:27:53 AM(UTC)
Rank: Premier Member

Yahoo! NCAA March Madness - Gold: 2015Yahoo! Fantasy Football - Gold: 2009FleaFlicker Fantasy Football - Silver: 2010Yahoo! NCAA March Madness - Silver: 2011ESPN NCAA March Madness - Bronze: 2010Yahoo! NCAA March Madness - Bronze: 2013

United States
Joined: 10/13/2006(UTC)
Location: Green Bay, WI
Applause Given: 2,385
Applause Received: 3,733
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.
Offline dhazer  
#5 Posted : Tuesday, September 8, 2009 10:48:30 AM(UTC)
Rank: Veteran Member

FleaFlicker Fantasy Football - Silver: 2013Yahoo! NCAA March Madness - Silver: 2016Yahoo! Fantasy Football - Bronze: 2009PackersHome NFL Pick'em - Bronze: 2013

Joined: 9/14/2008(UTC)
Applause Given: 96
Applause Received: 330
good job dj +1 for the code
Offline Rockmolder  
#6 Posted : Tuesday, September 8, 2009 11:00:09 AM(UTC)
Rank: Veteran Member

FleaFlicker Fantasy Football - Bronze: 2010

Netherlands
Joined: 9/14/2008(UTC)
Applause Given: 244
Applause Received: 384
" said: Go to Quoted Post
I have no idea what you are talking about, but thanks for keeping this site running!
Offline Porforis  
#7 Posted : Tuesday, September 8, 2009 12:25:50 PM(UTC)
Rank: Veteran Member

United States
Joined: 8/22/2009(UTC)
Location: Milwaukee, WI
Applause Given: 257
Applause Received: 511
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. :P
Offline Grabacr  
#8 Posted : Tuesday, September 8, 2009 12:56:17 PM(UTC)
Rank: Member

FleaFlicker Fantasy Football - Silver: 2015

United Kingdom
Joined: 9/28/2008(UTC)
Location: Nottingham, UK
Applause Given: 1
Applause Received: 14
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
Offline djcubez  
#9 Posted : Tuesday, September 8, 2009 3:03:42 PM(UTC)
Rank: Senior Member

FleaFlicker Fantasy Football - Gold: 2014

Joined: 8/7/2008(UTC)
Location: Madison
Applause Given: 11
Applause Received: 17
" said: Go to Quoted Post
good job dj +1 for the code

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.
Offline Zero2Cool  
#10 Posted : Tuesday, September 8, 2009 5:51:39 PM(UTC)
Rank: Premier Member

Yahoo! NCAA March Madness - Gold: 2015Yahoo! Fantasy Football - Gold: 2009FleaFlicker Fantasy Football - Silver: 2010Yahoo! NCAA March Madness - Silver: 2011ESPN NCAA March Madness - Bronze: 2010Yahoo! NCAA March Madness - Bronze: 2013

United States
Joined: 10/13/2006(UTC)
Location: Green Bay, WI
Applause Given: 2,385
Applause Received: 3,733
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.
Rss Feed 
Users browsing this topic
Guest
10 Pages123>»
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Notification

Icon
Error


Fan Shout
Smokey (1h) : Rest in Peace Arnold Palmer, you blessed us all .
hardrocker950 (9h) : What a strange weekend of football
jdlax (9h) : What's up, friends? It's like bizzaro world right now trailing the Vikings. Blah.
GoPack1984 (12h) : Ryan Fitzpatrick threw 6 interceptions!
TheKanataThrilla (15h) : Cleveland loses.
The_Green_Ninja (15h) : I swear, Jacksonville's hot weather must be a huge advantage. Kept it super close with the Ravens
TheKanataThrilla (15h) : Su'a Cravens with a big INT. A guy I wanted.
TheKanataThrilla (15h) : Can Cleveland win?
Zero2Cool (15h) : T.J. Lang said after one of Aaron Rodgers' TD passes the Packers quarterback head-butted Lang in excitement and said "I'm back."
Zero2Cool (19h) : Terrelle Pryor could see snaps at quarterback
Zero2Cool (19h) : inactives 6 Callahan 37 Shields 42 Burnett 52 Matthews 68 Murphy 95 Jones 98 Guion
Mucky Tundra (20h) : GET HYPE
Zero2Cool (20h) : Packers aim to showcase speed of Ty Montgomery, Trevor Davis
Zero2Cool (20h) : CB Quinten Rollins will start for Shields. Micah Hyde for Burnett. Julius Peppers for Matthews. Kenny Clark for Guion.
Tezzy (21h) : Probably will not be on the top of the Pick'Em leaderboard after today, soaking it in beforehand
Tezzy (22h) : Foosball!
yooperfan (23h) : Game day, tee it up and get this show on the road!
dyeah_gb (25-Sep) : Dyeah! Go Pack!
buckeyepackfan (25-Sep) : GOOD MORNING PACKER FANS! GAMEDAY! GO! PACK! GO!
flep (25-Sep) : Gameday!!! Will see you all in chat later
The_Green_Ninja (25-Sep) : Also, I'm not sure if you guys know. I'm a Memphis Tigers fan. Start looking a Riley Ferguson, QB. He is the real deal.
The_Green_Ninja (24-Sep) : Big whoop, we have Aaron. We are going to win. H8ers.
Zero2Cool (24-Sep) : Matthews, Burnett out; Guion, Jones doubtful
Zero2Cool (24-Sep) : thank ya
macbob (23-Sep) : HAPPY BIRTHDAY, KEVIN (yesterday...sigh...)
Zero2Cool (23-Sep) : Sam Shields has already been ruled out for Sunday's game.
Zero2Cool (23-Sep) : For Lions, Ansah is out. LBs Levy and Williams doubtful and Van Noy questionable. TE Ebron and DE Taylor questionable, too.
Zero2Cool (23-Sep) : Jimmy G sprained his AC joint
Mucky Tundra (23-Sep) : Brady is suspended and 2nd stringer Jimmy Garoppolo suffered a ACL sprain in week 2
Mucky Tundra (23-Sep) : Patriots 3rd stringer QB Jacoby Brissett injuried and needs surgery
Zero2Cool (23-Sep) : Quinten Rollins is the only NFL cornerback to play 20 or more snaps in the slot this year without allowing a catch
Porforis (23-Sep) : Cutler has better luck completing to Packers players 10+ yards downfield than Rodgers does. I say only mostly facetiously.
Smokey (23-Sep) : HELLO DAVE
The_Green_Ninja (23-Sep) : You people would think we have a QB worse than Cutler.
dyeah_gb (22-Sep) : Bench him!!!!
Please sign in to use Fan Shout

Road To Super Bowl LI
Sunday, Sep 11 @ 12:00 PM
at Jaguars
Sunday, Sep 18 @ 7:30 PM
at Vikings
Sunday, Sep 25 @ 12:00 PM
LIONS
Sunday, Oct 2 @ 12:00 AM
BYE
Sunday, Oct 9 @ 7:30 PM
GIANTS
Sunday, Oct 16 @ 3:25 PM
COWBOYS
Thursday, Oct 20 @ 7:25 PM
BEARS
Sunday, Oct 30 @ 12:00 PM
at Falcons
Sunday, Nov 6 @ 3:25 PM
COLTS
Sunday, Nov 13 @ 12:00 PM
at Titans
Sunday, Nov 20 @ 7:30 PM
at Redskins
Monday, Nov 28 @ 7:30 PM
at Eagles
Sunday, Dec 4 @ 12:00 PM
TEXANS
Sunday, Dec 11 @ 3:25 PM
SEAHAWKS
Sunday, Dec 18 @ 12:00 PM
at Bears
Saturday, Dec 24 @ 12:00 PM
VIKINGS
Sunday, Jan 1 @ 12:00 PM
at Lions

Think About It
Think About It

Recent Topics
2h / Green Bay Packers Talk / buckeyepackfan

3h / Green Bay Packers Talk / blueleopard

3h / Green Bay Packers Talk / blueleopard

3h / Green Bay Packers Talk / blueleopard

3h / Green Bay Packers Talk / blueleopard

6h / Green Bay Packers Talk / DoddPower

9h / Green Bay Packers Talk / jdlax

13h / Green Bay Packers Talk / nerdmann

15h / Green Bay Packers Talk / nerdmann

16h / Green Bay Packers Talk / TheKanataThrilla

19h / Green Bay Packers Talk / nerdmann

20h / Green Bay Packers Talk / nerdmann

20h / Green Bay Packers Talk / nerdmann

23-Sep / Green Bay Packers Talk / yooperfan

23-Sep / Green Bay Packers Talk / yooperfan


Packers Headlines