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 Pages«<34567>»
Options
Go to last post Go to first unread
Offline dhpackr  
#41 Posted : Sunday, September 20, 2009 1:53:01 PM(UTC)
Rank: Registered

Joined: 12/12/2007(UTC)
Applause Given: 36
Applause Received: 36
first, you need to write a validation function to ensure each radio button has been selected.

you have given each radio button its own variable in the database?? right.

its game time, and i am drinkin and eatin tacos.

after the game i may do some fishin.

Monday, when i get some time, i'll post some code for radio buttons, validation, and mysql.

unless you get it before hand.

go packers
Offline Zero2Cool  
#42 Posted : Sunday, September 20, 2009 1:56:38 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,446
Applause Received: 3,860
I won't have it before hand, lol. :)
Offline zombieslayer  
#43 Posted : Sunday, September 20, 2009 3:42:26 PM(UTC)
Rank: Registered

Joined: 8/7/2008(UTC)
Location: San Francisco
Applause Given: 778
Applause Received: 495
" said: Go to Quoted Post
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


Zero - If you were here in SF, you could get pretty good jobs knowing PHP pretty well. ASP not so much.
Offline dhpackr  
#44 Posted : Sunday, September 20, 2009 3:47:16 PM(UTC)
Rank: Registered

Joined: 12/12/2007(UTC)
Applause Given: 36
Applause Received: 36
" said: Go to Quoted Post
" said: Go to Quoted Post
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


Zero - If you were here in SF, you could get pretty good jobs knowing PHP pretty well. ASP not so much.


PHP ASP both scripting languages. I could work on apllications in San Fran from WI
Offline Zero2Cool  
#45 Posted : Sunday, September 20, 2009 3:52:11 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,446
Applause Received: 3,860
When submit clicked, check all games to ensure a selection has been made, if all selected, send each selection to database, if one or more was missing, indicate that to the user.

once all are sent, I'd like it to say

Zero2Coo's Winners for Week 01
Packers
Lions
etc


That's what I'm going for.
Offline dhpackr  
#46 Posted : Sunday, September 20, 2009 3:53:46 PM(UTC)
Rank: Registered

Joined: 12/12/2007(UTC)
Applause Given: 36
Applause Received: 36
ok mind you i got 4 beers and three shots in me, and i'm gonna hack this during half time

some basic php from the top of my head
?> ----start PHP
&lt;tr&gt;
&lt;td &gt;<b>Your Pick&lt;font color=red&gt;*&lt;/font&gt;</b>:&lt;/td&gt;
&lt;td&gt;
&lt;input type="radio" name="dhpackr" value="1" class="textbox"&lt;?if($dhpackr=="1"){echo " checked ;}?&gt;> Packers&lt;br&gt;
&lt;input type="radio" name="dhpackr" value="0" class="textbox"&lt;?if($dhpackr=="0"){echo " checked ";}?&gt;> Bengals

&lt;/td&gt;

&lt;/tr&gt;

&lt;?---end PHP
game on i gota go, but There is an exAMPLE of using a PHP scriipt to add an radio selection
this will echo out your selection.
add the dhpackr to your select/insert mysql statement and you would need a different variable for each selection.
some basic validation

function check_pick() {
//if (Auth::isAdmin())

//return true;
this chunck of code allows admin to
bypass validation remove the slashes to make it so admin would have to check all boxes


$is_valid = true;
if($this-&gt;dhpackr==""){
$is_valid=false;
$this->add_error('Make a selection!');
}
return $is_valid;

}

this project would take some serous maintanence
Offline dhpackr  
#47 Posted : Sunday, September 20, 2009 6:57:13 PM(UTC)
Rank: Registered

Joined: 12/12/2007(UTC)
Applause Given: 36
Applause Received: 36
i see some of ur errors now. if i could see the code i think i could make some progress
Offline Zero2Cool  
#48 Posted : Sunday, September 20, 2009 7:40:59 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,446
Applause Received: 3,860
Errors? I haven't tried coding it yet.

I don't know exactly how to go about what I want to do, yet.


I attached the file in question for ya.


When the page is loaded,

Check username for that week (tbl2009Week01) and to see if they have a selection made for game 01.
if selection found,
display "Usernames seslected winners for Week 01"
if selection not found,
display table of all games,
when submit button clicked, check to see if all games have a selection,
if all games are selected,
send selection one by one to db,
if all games are not selected,
alert user and request all selections to be made


Sound reasonable or am I being foolish?
Offline dhpackr  
#49 Posted : Sunday, September 20, 2009 8:13:58 PM(UTC)
Rank: Registered

Joined: 12/12/2007(UTC)
Applause Given: 36
Applause Received: 36
" said: Go to Quoted Post
Errors? I haven't tried coding it yet.

I don't know exactly how to go about what I want to do, yet.


I attached the file in question for ya.


When the page is loaded,

Check username for that week (tbl2009Week01) and to see if they have a selection made for game 01.
if selection found,
display "Usernames seslected winners for Week 01"
if selection not found,
display table of all games,
when submit button clicked, check to see if all games have a selection,
if all games are selected,
send selection one by one to db,
if all games are not selected,
alert user and request all selections to be made


Sound reasonable or am I being foolish?


no that is cool w/a few changes

i would create a new login page and new username and passwords.

you would have a form and have two fields username and password and the ability to create a new user as well

so....when a member clicked NFL Picks, it would take them to a login page.
the user could enter their username and password or create a new username and password. once they enter their username and password the would click a button this would take them to the weeks picks page.
you would have to change the text on the form every week
the picks could be entered into the db table based on their memberid. you would make this the primary key in the database and auto increment. so when the end user logs in, they are going to a weeks page that is unique to their id,

so their picks would be entered based on their login name.

so your page may look li ke this

?> ----start PHP
&lt;tr&gt;
&lt;td &gt;Pick1&lt;font color=red&gt;*&lt;/font&gt;:&lt;/td&gt;
&lt;td&gt;
&lt;input type="radio" name="Pick1" value="1" class="textbox"&lt;?if($Pick1=="1"){echo " checked ;}?&gt;> Packers&lt;br&gt;
&lt;input type="radio" name="Pick1" value="0" class="textbox"&lt;?if($Pick1=="0"){echo " checked ";}?&gt;> Bengals

&lt;/td&gt;

&lt;/tr&gt;


?> ----start PHP
&lt;tr&gt;
&lt;td &gt;Pick2&lt;font color=red&gt;*&lt;/font&gt;:&lt;/td&gt;
&lt;td&gt;
&lt;input type="radio" name="Pick2" value="1" class="textbox"&lt;?if($Pick2=="1"){echo " checked ;}?&gt;> Vikings&lt;br&gt;
&lt;input type="radio" name="Pick2" value="0" class="textbox"&lt;?if($Pick2=="0"){echo " checked ";}?&gt;> Lions

&lt;/td&gt;

&lt;/tr&gt;
and so on for 16 games, so you'll need 16 different variables in your database table.

the validation to make sure all picks are made

function check_pick() {
//if (Auth::isAdmin())

//return true;
this chunck of code allows admin to
bypass validation remove the slashes to make it so admin would have to check all boxes


$is_valid = true;
if($this->pick1=="" or $this->pick2=="" ){
$is_valid=false;
$this->add_error('Make a selection!');
}
return $is_valid;

}


the first part of code goes in your template file

the validation goes in your class file

do you have the functionality where those radio button selections are being stored in a db table, and then saved to a form b/c that is next. i can work on that 2moro.

this code can be displayed on another page that would display/confirm their picks
Offline Zero2Cool  
#50 Posted : Sunday, September 20, 2009 8:19:35 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,446
Applause Received: 3,860
The picks are predicated on the username already. It takes the global variable from the website. If you were to submit picks, it'd register as YOUR username :)
Rss Feed 
Users browsing this topic
Guest
10 Pages«<34567>»
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 (3h) : The TFFL could use 4 more like you Jon. Know any that wants to join next year ?
Smokey (4h) : I am proud of you Jon .
Smokey (4h) : Yes Jon, you can indeed be proud of your efforts . I am .
rabidgopher04 (4h) : league behind you and the other guy.
rabidgopher04 (4h) : @Smokey - tough competition for sure. I'm not holding my breath. Just glad I could rebound after a bad start. 3rd most points scored in the
Smokey (5h) : You won what other league dhazer ?
Smokey (5h) : for
Smokey (5h) : Low blow dhazer, 5 min. in the penalty box foe slashing ! lol
Smokey (5h) : Yes, fine job rabid. Now compete with the other 9 - 4 in the league . ;) LOL !
rabidgopher04 (6h) : Correction: I am second seed in the playoffs
rabidgopher04 (6h) : I crawled my way back from 2-6 to 7-6 to win my division and 3rd place in Tailgaters FFL. Playoff should be fun.
Zero2Cool (11h) : ;-)
dhazer (11h) : i clinched last place in the Packershome thanks to the awesome draft skills of smokey lol and won the other league
Zero2Cool (12h) : Wow. Rashaan Salaam was found dead Monday night at a park in Boulder. Police said there was no sign of foul play. He was 42
Pack93z (15h) : In one league I went from 2-5 to 8-5 and clinched a playoff spot... #Believe Best I have for the Packers at the moment.
Zero2Cool (18h) : Sweet. I backed my sweet ass into the playoffs. 8th and final seed.
Smokey (6-Dec) : Thank you Zero, I also just finished the Reg. Fantasy season at #1 . (Tailgaters Fantasy Football League ) .
The_Green_Ninja (5-Dec) : Same ol' Jay xD
Zero2Cool (5-Dec) : Aaron Rodgers over the last 7 games: 302 passing yards/game, 19 TDs, 3 INTs, 104.6 passer rating. 212 rushing yards, TD.
Zero2Cool (5-Dec) : Nice! I noticed you rocked your NFL Picks this week too! Nice work!!
Smokey (5-Dec) : Yes, he got me 29 fantasy points !
Zero2Cool (5-Dec) : Didn't David Johnson have a really good game though?
DarkaneRules (4-Dec) : cardinals run game looks worse than ours
Zero2Cool (4-Dec) : Packers inactives v Texans: WR Trevor Davis CB Makinton Dorleant ILB Blake Martinez OLB Kyler Fackrell RG Lang C Tretter DT Christian Ringo
buckeyepackfan (4-Dec) : GOOD MORNING PACKER FANS! GAMEDAY! GO! PACK! GO!
Zero2Cool (2-Dec) : lol
TheKanataThrilla (2-Dec) : That's a better description Zero thanks.
Zero2Cool (2-Dec) : I wasn't cheering for Cowboys. I was just hoping Vikings lose lol
Smokey (2-Dec) : NFLshop.com
TheKanataThrilla (2-Dec) : Seems best for our divisional prospects
hardrocker950 (2-Dec) : then don't
TheKanataThrilla (2-Dec) : It feels awful to cheer for the Cowboys.
Zero2Cool (30-Nov) : You know you don't have a Google sign in, so ... ahh ... don't click it :-) (having fun with ya)
Laser Gunns (30-Nov) : I don't mean to make the dupe, it happens when I try to sign in using the google account link thing.
Zero2Cool (29-Nov) : Erik Walden has as many sacks as Nick Perry.
Please sign in to use Fan Shout

2016 Packers Schedule
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 @ 3:25 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
1h / Green Bay Packers Talk / Smokey

1h / Green Bay Packers Talk / Smokey

3h / Green Bay Packers Talk / Smokey

3h / Green Bay Packers Talk / annaullock42

3h / Green Bay Packers Talk / mi_keys

4h / Green Bay Packers Talk / wpr

11h / Fantasy Sports Talk / Zero2Cool

13h / Green Bay Packers Talk / mi_keys

16h / Green Bay Packers Talk / steveishere

17h / Green Bay Packers Talk / Zero2Cool

20h / Fantasy Sports Talk / Smokey

21h / Green Bay Packers Talk / packerfanoutwest

6-Dec / Green Bay Packers Talk / beast

6-Dec / Green Bay Packers Talk / Cheesey

6-Dec / Green Bay Packers Talk / buckeyepackfan


Packers Headlines