dhpackr
15 years ago
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
So if you meet me Have some courtesy, Have some sympathy, and some taste
Use all your well-learned politesse, Or I'll lay your soul to waste
Zero2Cool
15 years ago
I won't have it before hand, lol. 🙂
UserPostedImage
zombieslayer
15 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

"Zero2Cool" wrote:



Zero - If you were here in SF, you could get pretty good jobs knowing PHP pretty well. ASP not so much.
My man Donald Driver
UserPostedImage
(thanks to Pack93z for the pic)
2010 will be seen as the beginning of the new Packers dynasty. 🇹🇹 🇲🇲 🇦🇷
dhpackr
15 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

"zombieslayer" wrote:



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

"Zero2Cool" wrote:



PHP ASP both scripting languages. I could work on apllications in San Fran from WI
So if you meet me Have some courtesy, Have some sympathy, and some taste
Use all your well-learned politesse, Or I'll lay your soul to waste
Zero2Cool
15 years ago
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.
UserPostedImage
dhpackr
15 years ago
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
<tr>
<td >Your Pick<font color=red>*</font>:</td>
<td>
<input type="radio" name="dhpackr" value="1" class="textbox"<?if($dhpackr=="1"){echo " checked ;}?>> Packers<br>
<input type="radio" name="dhpackr" value="0" class="textbox"<?if($dhpackr=="0"){echo " checked ";}?>> Bengals

</td>

</tr>

<?---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->dhpackr==""){
$is_valid=false;
$this->add_error('Make a selection!');
}
return $is_valid;

}

this project would take some serous maintanence
So if you meet me Have some courtesy, Have some sympathy, and some taste
Use all your well-learned politesse, Or I'll lay your soul to waste
dhpackr
15 years ago
i see some of ur errors now. if i could see the code i think i could make some progress
So if you meet me Have some courtesy, Have some sympathy, and some taste
Use all your well-learned politesse, Or I'll lay your soul to waste
Zero2Cool
15 years ago
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?
UserPostedImage
dhpackr
15 years ago

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?

"Zero2Cool" wrote:



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
<tr>
<td >Pick1<font color=red>*</font>:</td>
<td>
<input type="radio" name="Pick1" value="1" class="textbox"<?if($Pick1=="1"){echo " checked ;}?>> Packers<br>
<input type="radio" name="Pick1" value="0" class="textbox"<?if($Pick1=="0"){echo " checked ";}?>> Bengals

</td>

</tr>


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

</td>

</tr>
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
So if you meet me Have some courtesy, Have some sympathy, and some taste
Use all your well-learned politesse, Or I'll lay your soul to waste
Zero2Cool
15 years ago
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 🙂
UserPostedImage
Fan Shout
Zero2Cool (14h) : Benton unsigned no more
Zero2Cool (17-Jul) : That's good analysis, yes you are getting old. It'd a blessing!
dfosterf (14-Jul) : *analysis* gettin' old
dfosterf (14-Jul) : One of the best analyisis I"ve ever watched at this time of an offseason
dfosterf (14-Jul) : Andy Herman interviewed Warren Sharp on his Pack a day podcast
packerfanoutwest (10-Jul) : Us Padres fans love it....But it'll be a Dodgers/Yankees World Series
Zero2Cool (9-Jul) : Brewers sweep Dodgers. Awesome
Mucky Tundra (6-Jul) : And James Flanigan is the grandson of Packers Super Bowl winner Jim Flanigan Sr.
Mucky Tundra (6-Jul) : Jerome Bettis and Jim Flanigans sons as well!
Zero2Cool (6-Jul) : Thomas Davis Jr is OLB, not WR. Oops.
Zero2Cool (6-Jul) : Larry Fitzgeral and Thomas Davis sons too. WR's as well.
Mucky Tundra (5-Jul) : Kaydon Finley, son of Jermichael Finley, commits to Notre Dame
dfosterf (3-Jul) : Make sure to send my props to him! A plus move!
Zero2Cool (3-Jul) : My cousin, yes.
dfosterf (3-Jul) : That was your brother the GB press gazette referenced with the red cross draft props thing, yes?
Zero2Cool (2-Jul) : Packers gonna unveil new throwback helmet in few weeks.
Mucky Tundra (2-Jul) : I know it's Kleiman but this stuff writes itself
Mucky Tundra (2-Jul) : "Make sure she signs the NDA before asking for a Happy Ending!"
Mucky Tundra (2-Jul) : @NFL_DovKleiman Powerful: Deshaun Watson is taking Shedeur Sanders 'under his wing' as a mentor to the Browns QBs
Zero2Cool (30-Jun) : Dolphins get (back) Minkah Fitzpatrick in trade
Zero2Cool (30-Jun) : Steelers land Jalen Ramsey via Trade
dfosterf (26-Jun) : I think it would be great to have someone like Tom Grossi or Andy Herman on the Board of Directors so he/they could inform us
dfosterf (26-Jun) : Fair enough, WPR. Thing is, I have been a long time advocate to at least have some inkling of the dynamics within the board.
wpr (26-Jun) : 1st world owners/stockholders problems dfosterf.
Martha Careful (25-Jun) : I would have otherwise admirably served
dfosterf (25-Jun) : Also, no more provision for a write-in candidate, so Martha is off the table at least for this year
dfosterf (25-Jun) : You do have to interpret the boring fine print, but all stockholders all see he is on the ballot
dfosterf (25-Jun) : It also says he is subject to another ballot in 2028. I recall nothing of this nature with Murphy
dfosterf (25-Jun) : Ed Policy is on my ballot subject to me penciling him in as a no.
dfosterf (25-Jun) : I thought it used to be we voted for the whatever they called the 45, and then they voted for the seven, and then they voted for Mark Murphy
dfosterf (25-Jun) : Because I was too lazy to change my address, I haven't voted fot years until this year
dfosterf (25-Jun) : of the folks that run this team. I do not recall Mark Murphy being subject to our vote.
dfosterf (25-Jun) : Ed Policy yay or nay is on the pre-approved ballot that we always approve because we are uninformed and lazy, along with all the rest
dfosterf (25-Jun) : Weird question. Very esoteric. For stockholders. Also lengthy. Sorry. Offseason.
Zero2Cool (25-Jun) : Maybe wicked wind chill made it worse?
Mucky Tundra (25-Jun) : And then he signs with Cleveland in the offseason
Mucky Tundra (25-Jun) : @SharpFootball WR Diontae Johnson just admitted he refused to enter a game in 41° weather last year in Baltimore because he felt “ice cold”
Zero2Cool (24-Jun) : Yawn. Rodgers says he is "pretty sure" this be final season.
Zero2Cool (23-Jun) : PFT claims Packers are having extension talks with Zach Tom, Quay Walker.
Mucky Tundra (20-Jun) : GB-Minnesota 2004 Wild Card game popped up on my YouTube page....UGH
beast (20-Jun) : Hmm 🤔 re-signing Walker before Tom? Sounds highly questionable to me.
Mucky Tundra (19-Jun) : One person on Twitter=cannon law
Zero2Cool (19-Jun) : Well, to ONE person on Tweeter
Zero2Cool (19-Jun) : According to Tweeter
Zero2Cool (19-Jun) : Packers are working on extension for LT Walker they hope to have done before camp
dfosterf (18-Jun) : E4B landed at Andrews last night
dfosterf (18-Jun) : 101 in a 60
dfosterf (18-Jun) : FAFO
Zero2Cool (18-Jun) : one year $4m with incentives to make it up to $6m
dfosterf (18-Jun) : Or Lions
Please sign in to use Fan Shout
2025 Packers Schedule
Sunday, Sep 7 @ 3:25 PM
LIONS
Thursday, Sep 11 @ 7:15 PM
COMMANDERS
Sunday, Sep 21 @ 12:00 PM
Browns
Sunday, Sep 28 @ 7:20 PM
Cowboys
Sunday, Oct 12 @ 3:25 PM
BENGALS
Sunday, Oct 19 @ 3:25 PM
Cardinals
Sunday, Oct 26 @ 7:20 PM
Steelers
Sunday, Nov 2 @ 12:00 PM
PANTHERS
Monday, Nov 10 @ 7:15 PM
EAGLES
Sunday, Nov 16 @ 12:00 PM
Giants
Sunday, Nov 23 @ 12:00 PM
VIKINGS
Thursday, Nov 27 @ 12:00 PM
Lions
Sunday, Dec 7 @ 12:00 PM
BEARS
Sunday, Dec 14 @ 3:25 PM
Broncos
Friday, Dec 19 @ 11:00 PM
Bears
Friday, Dec 26 @ 11:00 PM
RAVENS
Saturday, Jan 3 @ 11:00 PM
Vikings
Recent Topics
6h / Green Bay Packers Talk / Mucky Tundra

7h / Green Bay Packers Talk / wpr

15h / Green Bay Packers Talk / Zero2Cool

18-Jul / Green Bay Packers Talk / Mucky Tundra

15-Jul / Green Bay Packers Talk / Mucky Tundra

14-Jul / Green Bay Packers Talk / Mucky Tundra

10-Jul / Green Bay Packers Talk / beast

10-Jul / Around The NFL / Zero2Cool

6-Jul / Random Babble / Martha Careful

4-Jul / Green Bay Packers Talk / wpr

2-Jul / Green Bay Packers Talk / dfosterf

2-Jul / Fantasy Sports Talk / dfosterf

1-Jul / Green Bay Packers Talk / wpr

29-Jun / Green Bay Packers Talk / Zero2Cool

25-Jun / Around The NFL / Martha Careful

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