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
    Martha Careful (10h) : Z, could you please combine my thread with yours please. I obviously did not see it when I Created it
    Martha Careful (13h) : Re: 'Kool-Aid' McKinstry. Other than Icky Woods, has there ever been a good NFLer with a childish nickname?
    Martha Careful (14h) : Packers looking to trade up
    Martha Careful (17h) : Flag?
    Martha Careful (17h) : Sag?
    Nonstopdrivel (17h) : It rhymes with "bag."
    beast (26-Apr) : Family? That's Deadpool's F word
    Nonstopdrivel (26-Apr) : Not THAT f-word.
    Zero2Cool (26-Apr) : fuck
    beast (25-Apr) : 49ers are Cap Tight
    beast (25-Apr) : Fuck
    Mucky Tundra (25-Apr) : Kanata, I will be when I'm on my lunch later
    TheKanataThrilla (25-Apr) : Love you NSD
    Nonstopdrivel (25-Apr) : Huh. I guess the F-word is censored in this fan shout.
    Nonstopdrivel (25-Apr) : Anyone who doesn't hang out in the chat probably smokes pole.
    TheKanataThrilla (25-Apr) : GoPackGo Thinking CB is the pick tonight
    TheKanataThrilla (25-Apr) : Anyone hanging out in the chat tonight?
    Zero2Cool (25-Apr) : whoa...49ers have had trade conversations about both Deebo Samuel and Brandon Aiyuk
    Zero2Cool (25-Apr) : I hope they take a Punter at 9th overall. Be bold!
    Mucky Tundra (25-Apr) : I may end up eating those words but I think they need a lot more talent then their 4 picks can provide
    Mucky Tundra (25-Apr) : I really hope they stand pat and Draft a WR
    Mucky Tundra (25-Apr) : @DMRussini
    Mucky Tundra (25-Apr) : The Chicago Bears are very open for business at 9 and telling teams they are ready to move for the right price, per source
    buckeyepackfan (24-Apr) : Lions extend Penei Soul 4yrs - 112mil
    buckeyepackfan (24-Apr) : Lions extend St. Brown 4 years 120mil and
    Mucky Tundra (24-Apr) : Now look, trading up to 13 to take a TE might not seem like a good idea later but it will be later!
    dfosterf (24-Apr) : (Your trade up mock post)
    dfosterf (24-Apr) : Mucky- The only thing fun to watch would be me flipping the f out if Gute goes up to 13 and grabs Brock Bowers, lol
    beast (24-Apr) : DT Byron Murphy II, Texas... whom some believe is the next Aaron Donald (or the closest thing to Donald)
    Zero2Cool (24-Apr) : What? And who?
    Mucky Tundra (24-Apr) : *sad Mucky noises*
    Mucky Tundra (24-Apr) : @JoeJHoyt Murphy said he’s been told he won’t slide past pick No. 16.
    wpr (23-Apr) : Just about time to watch Sonny Weaver stick it to the seahags. I never get tired of it.
    Martha Careful (23-Apr) : *game plan
    Martha Careful (23-Apr) : IMHO, not even close. He is not a guy you game play around.
    Mucky Tundra (23-Apr) : is Aiyuk worth a 1st rounder?
    Zero2Cool (23-Apr) : 49ers are seeking a 1st round pick in exchange for WR Brandon Aiyuk
    Mucky Tundra (22-Apr) : Based on Gutes comments, now I don't feel as silly having 13 picks in my mock the other day
    Zero2Cool (22-Apr) : Zach Wilson to Broncos.
    Zero2Cool (22-Apr) : Gutekunst says he'd love to have 13 or 14 picks. He's trading back huh lol
    beast (22-Apr) : Someday we'll have a draft betting scandal
    beast (21-Apr) : Sometimes looking extremely amazing, sometimes looking extremely lost
    beast (21-Apr) : I haven't looked into the QBs, but some have suggested Maye has some of the most extremely inconsistent tape they've seen
    beast (21-Apr) : Well it also sounds like Patriots are listening to trade offers, not that seriously considering any, but listening means they aren't locked
    Zero2Cool (21-Apr) : Maye needs to be AFC
    Mucky Tundra (21-Apr) : Not liking the idea of the Vikings getting Maye
    Zero2Cool (21-Apr) : Vikings HC joked that he may or may not have sent flowers to Bob Kraft. That's where rumor came from.
    beast (21-Apr) : Can't tell if this is real or BS, but some rumors about a possible Patriots/Vikings trade for #3 overall
    dfosterf (21-Apr) : One playbook to my knowledge. I was shooting for facetious.
    beast (20-Apr) : I'm not sure they have different playbooks for different OL positions, and Dillard run blocking is supposedly worse than his pass blocking..
    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
    2h / Green Bay Packers Talk / Mucky Tundra

    3h / Green Bay Packers Talk / Mucky Tundra

    3h / Green Bay Packers Talk / Mucky Tundra

    3h / Green Bay Packers Talk / Mucky Tundra

    4h / Green Bay Packers Talk / Mucky Tundra

    10h / Green Bay Packers Talk / Martha Careful

    13h / Green Bay Packers Talk / beast

    14h / Green Bay Packers Talk / beast

    23h / Green Bay Packers Talk / Zero2Cool

    26-Apr / Green Bay Packers Talk / Nonstopdrivel

    25-Apr / Green Bay Packers Talk / beast

    25-Apr / Green Bay Packers Talk / buckeyepackfan

    25-Apr / Green Bay Packers Talk / bboystyle

    24-Apr / Random Babble / beast

    22-Apr / Green Bay Packers Talk / Mucky Tundra

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