Discussion Board
Welcome Guest! You can login or register. Login or Register.
5 Pages123>»

Options
Go to last post Go to first unread
Zero2Cool  
#1 Posted : Tuesday, September 8, 2009 12:27:07 AM(UTC)
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
IronMan  
#2 Posted : Tuesday, September 8, 2009 1:04:32 AM(UTC)
I have no idea what you are talking about, but thanks for keeping this site running!
djcubez  
#3 Posted : Tuesday, September 8, 2009 1:34:41 AM(UTC)
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>
Zero2Cool  
#4 Posted : Tuesday, September 8, 2009 2:27:53 AM(UTC)
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.
dhazer  
#5 Posted : Tuesday, September 8, 2009 10:48:30 AM(UTC)
good job dj +1 for the code
Rockmolder  
#6 Posted : Tuesday, September 8, 2009 11:00:09 AM(UTC)
" said: Go to Quoted Post
I have no idea what you are talking about, but thanks for keeping this site running!
Porforis  
#7 Posted : Tuesday, September 8, 2009 12:25:50 PM(UTC)
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
Grabacr  
#8 Posted : Tuesday, September 8, 2009 12:56:17 PM(UTC)
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
djcubez  
#9 Posted : Tuesday, September 8, 2009 3:03:42 PM(UTC)
" 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.
Zero2Cool  
#10 Posted : Tuesday, September 8, 2009 5:51:39 PM(UTC)
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.
djcubez  
#11 Posted : Wednesday, September 9, 2009 12:16:53 AM(UTC)
" said: Go to Quoted Post
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.

I'll see what I can do. Schools a bit heavy now but come this weekend I might be able to set aside some time.
Zero2Cool  
#12 Posted : Wednesday, September 9, 2009 8:57:14 AM(UTC)
" said: Go to Quoted Post
" said: Go to Quoted Post
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.

I'll see what I can do. Schools a bit heavy now but come this weekend I might be able to set aside some time.


Oh, you're in school. No worries, I don't want to take up any of your time. I know how it is with school, so no worries bud. :) I'm sure I'll figure it out. You've given me a great starting point. Thanks.
Formo  
#13 Posted : Wednesday, September 9, 2009 3:03:53 PM(UTC)
" said: Go to Quoted Post
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>

-=snip snip=-
UserPostedImage
Porforis  
#14 Posted : Wednesday, September 9, 2009 4:31:03 PM(UTC)
lol 4chan?
dhpackr  
#15 Posted : Wednesday, September 9, 2009 8:43:17 PM(UTC)
did u get ur form to work??
i work with php/mysql database driven forms A LOT.
check boxes,radio buttons, drop down lists all the time.
i do not think the code posted is correct.
keep in mind u may have to edit more than 1 file and 1 function.

is there a template file
a class file
and a db file
and a index file
so to get the data to post to the database, and display on the form u may have to edit more than 1 file and 1 function. also, do you want to edit the selection, and give the user the ability to change a selection.

PHP is like c or java. u may need to edit a class and the functions within that class.
Zero2Cool  
#16 Posted : Wednesday, September 9, 2009 8:53:32 PM(UTC)
I haven't worked further on it. Kind of strapped for time.

My goal for this project is to link it with the website's database but only read the members column. Then upload the data to a separate database built specifically for this.

What you see above, is all I have thus far. I have an example of connecting to a db, reading, updating, importing, but storing the picks into variables TO be processed into the db is my flaw.
dhpackr  
#17 Posted : Wednesday, September 9, 2009 9:11:44 PM(UTC)
i will shoot you some code samples next week. say tues night.
i work programming during the week and had a long day today. I work on forms all the time, its all i do.

i have used vb.net and ektron, but really got started doing classic asp. i have been doing php forms since july 1. basically, adding drop downs, radio buttons, check boxes, text feilds and validation to a program that already exists.

like i said PHP is like java or c. you have to edit several files and several functions for the program to work properly.
Zero2Cool  
#18 Posted : Wednesday, September 9, 2009 11:14:34 PM(UTC)
I've been programming professionally in VB.NET for two years. That's my strong spot, thus, me wanting to use ASP.NET :)

I did Java and C++ in college. I can 'do' it, if I have to, but not a fan of C++.

PHP and HTML I've been doing on/off for nearly a dozen years. I've built from the ground up with HTML, and with PHP I've only manipulated what I've seen to do as I want.

Just so you know the kind of dumb programmer you're working with here, lol.

Thinking more about this ...
This will all be with one database. I'll export the members from the website db, into the nfl picks db.
I'm siding with making this a module built into the website, not sure yet.
There will be several pages...
Log In
Current Standings
Weekly Winner
Each Week's Picks (with submit and finalize options) This means you can submit your picks, come back to them the day prior to the game, change them and hit 'finalize' to finalize your picks.

I think this is fairly simple to do, but don't have the time to get it all done. I was hoping to have it done this off season, but with ASP.NET. And after paying for two extra hosting packages and failing to meet my speed requirement for the forums, I've decided PHP is the best option as I know I can learn it, slowly but surely, lol.






Any help from you or dj is greatly appreciated or anyone else whom wants to help out.
dhpackr  
#19 Posted : Thursday, September 10, 2009 4:30:29 PM(UTC)
well, you are on the right track 4-sho.

1 database
4 tables

Log In table
Current Standings table
Weekly Winner table
Each Week's Picks table

now, you'll need your login page
this will have a
template page
a class page
a login.php page
a db class page

a current standings page

this will have a
template page
a class page
a db class page

Weekly Winner page
this will have a
template page
a class page
a db class page

Each Week's Picks page
this will have a
template page
a class page
a db class page

with in the class pages, you will put your functions to store and retrieve your data as well as the functionality to save pics and change the picks..

what do you think.

BTW do not get me started talkin about programming. i am an junkie. i just started 4 years ago. two years of school, got hired for a fullt time programming job before i even graduated. worked 14 months full time, then the next 5 months part time.

i have received no training, just been cut loose on live projects since day 1. i've coded in cold fusion, vb6, vb.net, classic asp, sql, javascript, css, html, mysql, php.

mainly doing various database driven forms and validation. no fancy graphics or code editors.

my week is over no more coding for this week, & i'm going fishing. chat next week.
Pack93z  
#20 Posted : Thursday, September 10, 2009 4:35:02 PM(UTC)
I thought we scrapped this project with the failed host move.. but the design that DH has listed looks pretty solid overall.. +1.

However maybe link the login credentials from here to the other app..
Rss Feed
Users browsing this topic
Guest
5 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
Zero2Cool (50m) : NFL Draft is tonight, right?
Tezzy (18h) : \_/ Smokey!
Smokey (26-Apr) : \_/ Tezzy
Tezzy (26-Apr) : I feel we are on the cusp of a special time of Packers football. My optimism for the rest of the 2000-teens is strong.
Tezzy (26-Apr) : Sign Cutler and draft a QB in round 1. Go Pack Go!!!!
TheKanataThrilla (25-Apr) : I will be there with beer in hand.
Smokey (25-Apr) : CHAT and Draft Thursday night in the PACKERSHOME CHAT ROOM ! Don't forget the cold beer .
TheKanataThrilla (21-Apr) : Seattle at Pack week 1. Hopefully Aaron gets some reps this preseason.
TheKanataThrilla (20-Apr) : Ruben Foster tests positive for weed. Any chance he falls to us? Probably not.
Smokey (20-Apr) : Thanks wpr, I'll order a L.Pizza !
wpr (20-Apr) : Smokey the chat room has been available for prior drafts
Smokey (20-Apr) : Great News , Zero . Also will the "Chat" room be up and operating for the 1st round of the NFL Draft ?
Zero2Cool (20-Apr) : Packers schedule coming out today, 7pm CST
Zero2Cool (19-Apr) : Fans should care about Dean Blandino’s departure from the NFL because it matters…a lot http://ble.ac/2osxh74
Zero2Cool (19-Apr) : Aaron Hernandez found dead in prison cell
Tezzy (18-Apr) : That stat line of 142 of 144 regular season games
Zero2Cool (18-Apr) : A.J. Hawk will retire with the @packers after recording the most tackles in franchise history (1,118)
Smokey (14-Apr) : Hernandez already convicted of previous two murders .
Smokey (14-Apr) : Aaron Hermandez found Not Guilty of Murder Charges .
Smokey (11-Apr) : Packers will play the Eagles , Redskins , Broncos , and Rams in Preseason 2017 .
Zero2Cool (11-Apr) : Odd to see GM John Lynch .. I won't get used to that for a while haha
Cheesey (10-Apr) : I don't think she has anything to do with how he plays on the field.
Porforis (7-Apr) : 100% conjecture but maybe they've been on the rocks and that contributed to his long slump?
Zero2Cool (7-Apr) : Aaron Rodgers and actress Olivia Munn break up, People magazine reports. Here we go
Porforis (7-Apr) : Forum needs some FOOTBAH! l.
gbguy20 (6-Apr) : forum needs some uffda
Zero2Cool (5-Apr) : Marshawn Lynch told the @RAIDERS he intends to un-retire.
iscmarkiemark (5-Apr) : Garrett could be gone in the 1st even..
Smokey (2-Apr) : A REMINDER: Easter Sunday falls on April 16th .
Smokey (1-Apr) : Avoid the Rush, join today !
Zero2Cool (31-Mar) : 8 of 12 top draft picks from 2013 - are no longer with the team that drafted them...
FLORIDA PACKER88 (31-Mar) : I don't think Myles Garrett will be there in the 3rd haha
Nonstopdrivel (30-Mar) : NFL Network predicting Packers to trade out of 2nd round to snag Myles Garrett (DE, Texas A&M) in the 3rd round.
Smokey (30-Mar) : Packers sign OG Justin McCray, 321 lbs out of C.Florida .
Cheesey (29-Mar) : She wanted people to recognize who it was, and that was the only way anyone would!LOL!
Please sign in to use Fan Shout
2017 Packers Schedule
Sunday, Sep 10 @ 3:25 PM
SEAHAWKS
Sunday, Sep 17 @ 7:30 PM
at Falcons
Sunday, Sep 24 @ 3:25 PM
BENGALS
Thursday, Sep 28 @ 7:25 PM
BEARS
Sunday, Oct 8 @ 3:25 PM
at Cowboys
Sunday, Oct 15 @ 12:00 PM
at Vikings
Sunday, Oct 22 @ 12:00 PM
SAINTS
Sunday, Oct 29 @ 12:00 AM
- BYE -
Monday, Nov 6 @ 7:30 PM
LIONS
Sunday, Nov 12 @ 12:00 PM
at Bears
Sunday, Nov 19 @ 12:00 PM
RAVENS
Sunday, Nov 26 @ 7:30 PM
at Steelers
Sunday, Dec 3 @ 12:00 PM
BUCCANEERS
Sunday, Dec 10 @ 12:00 PM
at Browns
Saturday, Dec 23 @ 7:30 PM
VIKINGS
Sunday, Dec 31 @ 12:00 PM
at Lions
Saturday, Dec 17 @ 12:00 PM
at Panthers
Think About It
Think About It
Recent Topics
32m / Green Bay Packers Talk / DarkaneRules

14h / Green Bay Packers Talk / nerdmann

19h / Green Bay Packers Talk / wpr

20h / Green Bay Packers Talk / wpr

26-Apr / Green Bay Packers Talk / Tezzy

26-Apr / Green Bay Packers Talk / Tezzy

25-Apr / Green Bay Packers Talk / PackFanWithTwins

24-Apr / Green Bay Packers Talk / PackFanWithTwins

24-Apr / Green Bay Packers Talk / PackFanWithTwins

23-Apr / Green Bay Packers Talk / 68md

22-Apr / Green Bay Packers Talk / Zero2Cool

21-Apr / Green Bay Packers Talk / FLORIDA PACKER88

20-Apr / Around The NFL / Smokey

19-Apr / Green Bay Packers Talk / wpr

19-Apr / Green Bay Packers Talk / sschind

Headlines