dhpackr
14 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
14 years ago
I won't have it before hand, lol. πŸ™‚
UserPostedImage
zombieslayer
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

"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
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

"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
14 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
14 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
14 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
14 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
14 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
14 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
Users browsing this topic
    Fan Shout
    dfosterf (51m) : The only problem with that is he isn't a guard either.
    dfosterf (1h) : Put him at right guard. That is where he will be coached. That is where he will compete. He is not even allowed to look at the LT playbook.
    dfosterf (17h) : Kidding aside, I hope the best for him.
    dfosterf (17h) : Went to a Titans board. One comment there. Not very long. I quote: "LOL" They don't sound overly upset about our aquisition.
    beast (17h) : OT Dillard has been absolutely horrible... like OG Newman levels
    dfosterf (18h) : Suit him up and have him stand in front of the big board as a draft day cautionary tale.
    Zero2Cool (18h) : Packers sign T Andre Dillard.
    Mucky Tundra (18-Apr) : Adds most of the information this time of year comes from agents.
    Mucky Tundra (18-Apr) : @RealAlexBarth Bill Belichick says accurate draft information doesn't leak from teams until about 12 hours before the draft. Adds most of th
    Mucky Tundra (18-Apr) : I am very happy that for moment, Jordan Love seems like a normal human being
    Zero2Cool (17-Apr) : Belichick * whatever
    Zero2Cool (17-Apr) : "There's a lot of depth at Offensive Tackle and Wide Receiver." Bill Bellichick
    Zero2Cool (17-Apr) : Thanks! I can't believe it's over haha
    Martha Careful (16-Apr) : Congratulations
    Zero2Cool (16-Apr) : Boom. Student Loan. $0.00. Only took about 20 years.
    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
    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
    1h / Green Bay Packers Talk / dfosterf

    10h / Green Bay Packers Talk / Mucky Tundra

    14h / Random Babble / Zero2Cool

    21h / Green Bay Packers Talk / Zero2Cool

    18-Apr / Random Babble / Mucky Tundra

    18-Apr / Green Bay Packers Talk / Mucky Tundra

    17-Apr / Green Bay Packers Talk / Mucky Tundra

    17-Apr / Green Bay Packers Talk / Mucky Tundra

    17-Apr / Green Bay Packers Talk / beast

    17-Apr / Green Bay Packers Talk / beast

    17-Apr / Green Bay Packers Talk / beast

    16-Apr / Random Babble / Martha Careful

    15-Apr / Green Bay Packers Talk / dfosterf

    12-Apr / Random Babble / Nonstopdrivel

    12-Apr / Green Bay Packers Talk / Martha Careful

    Headlines
    Copyright Β© 2006 - 2024 PackersHome.comβ„’. All Rights Reserved.