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 (12h) : Maybe
    Mucky Tundra (12h) : Yes
    Zero2Cool (14h) : No.
    Mucky Tundra (16h) : End of a Degu-era
    dhazer (16h) : Steelers sign Patterson because of new kickoff rule interesting
    Zero2Cool (19h) : Former #Packers TE Josiah Deguara is signing a 1-year deal with the Jaguars, per source.
    Zero2Cool (20h) : They do not do it for "content sake".
    dfosterf (28-Mar) : For the record, I enjoy Beast and Mucky drafts
    Zero2Cool (27-Mar) : Haha
    Mucky Tundra (27-Mar) : No time for talking! Back to work beast!
    beast (27-Mar) : You saw only 4,201 of my mocks? 🥺 I think that means you missed more than half of them 😢
    dfosterf (27-Mar) : Does anyone know what Lambeau field improvements got put on hold? My guess would be for the 2025 draft
    Zero2Cool (27-Mar) : It's like listen, you made 4,201 mocks, no shit.
    Zero2Cool (27-Mar) : Cuz during the draft "I had them mocked there!" as if it's amazing.
    Zero2Cool (27-Mar) : They're fun to do once in awhile. It's people who think they are "content" that annoy me.
    dfosterf (27-Mar) : Against tbd
    dfosterf (27-Mar) : Answer to your question is yes, it's a Thursday, will be the Chiefs aga
    dfosterf (27-Mar) : Luckily for all concerned, I don't post them. I did one, but that was like 25 mocks ago
    Zero2Cool (27-Mar) : NFL 2024 gonna start Sept 5th isn't it???
    Zero2Cool (27-Mar) : Ugh... kids these days!
    dfosterf (27-Mar) : I'm gonna go do some more mock draft hell instead 🤪
    Zero2Cool (27-Mar) : Did we do one of those prediction threads yet for 2024 season?
    dfosterf (27-Mar) : In my city, they are playing the nimby game, in order to keep some railroad tracks vs. 2 professional sports teams and a concert venue.
    dfosterf (27-Mar) : And/Or a city council, of which I haven't seen a good one in a very long time
    dfosterf (27-Mar) : That sounds like a Mayor, not a city.
    buckeyepackfan (26-Mar) : Packers halt scheduled 80mil upgrade of stadium until lease agreement talks are restarted
    Zero2Cool (26-Mar) : City of Green Bay puts Packers' Lambeau Field lease talks on hold
    buckeyepackfan (26-Mar) : Packers 1 of 3 teams to vote no on new kickoff rule.
    Zero2Cool (26-Mar) : Packers sign another Kicker
    dfosterf (26-Mar) : Lengthy explanation at PFF if you click the link
    dfosterf (26-Mar) : Kickoff rules officially changed.ngthy explan
    Zero2Cool (26-Mar) : lol
    Cheesey (26-Mar) : 2009? No thanks! One open heart surgery is enough!
    dfosterf (26-Mar) : Good for you!
    Zero2Cool (26-Mar) : Yes. That's the one.
    dfosterf (26-Mar) : Is that "Lady Dugan" per chance?
    dfosterf (26-Mar) : Crystal?
    dfosterf (26-Mar) : Please refresh my memory
    Zero2Cool (26-Mar) : Alan posts. Crystal back in my life. It's 2009 all over again! Lol
    Mucky Tundra (26-Mar) : BAH GAWD! THAT'S CHEESEYS MUSIC!
    Zero2Cool (25-Mar) : Gutekunst said early stages of Jordan Love contract being discussed.
    Zero2Cool (25-Mar) : Shouldn't be penalized cuz official screwed up
    Zero2Cool (25-Mar) : Yeah, challenge until you are incorrect twice.
    Zero2Cool (25-Mar) : Fining them is the goal, per the people who made the rule anyway.
    dfosterf (25-Mar) : Still waiting on the kickoff rule changes. Did hear yesterday that the touchback proposal will now be the 30 yard line, not the 35
    dfosterf (25-Mar) : Probably speed of game issues with your proposal
    dfosterf (25-Mar) : Hopefully the refs don't get in the habit of throwing flags on this
    beast (25-Mar) : I think when it comes to Challenges should get two strikes, so unlimited challenges as long as they keep winning them, but 2 wrong then done
    dfosterf (25-Mar) : Still subject to the fines etc
    dfosterf (25-Mar) : Yes, I should have been more specific. Also, they are now saying it would be a 15 yard penalty. That makes more sense .
    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
    7h / Around The NFL / beast

    12h / Green Bay Packers Talk / buckeyepackfan

    28-Mar / Green Bay Packers Talk / dfosterf

    28-Mar / Green Bay Packers Talk / bboystyle

    27-Mar / Green Bay Packers Talk / Mucky Tundra

    27-Mar / Random Babble / Zero2Cool

    27-Mar / Green Bay Packers Talk / beast

    26-Mar / Green Bay Packers Talk / beast

    26-Mar / Green Bay Packers Talk / beast

    26-Mar / Green Bay Packers Talk / bboystyle

    25-Mar / Green Bay Packers Talk / Zero2Cool

    25-Mar / Green Bay Packers Talk / Zero2Cool

    24-Mar / Green Bay Packers Talk / beast

    24-Mar / Green Bay Packers Talk / beast

    22-Mar / Green Bay Packers Talk / beast

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