Jump to content

Recommended Posts

I have no experince in  php.  I need my NCAA bracket form to get emailed to me from my web page. I have been told that I need to write in  a PHP code and have a server side host.  I have a web site that supports PHP and have gotten a Mysql host/database.  I have made a 64 team bracket that when a team is picked advances the team to the next round with final four and championship game.  When this is filled out I would like it sent to me via email.  Here is what I have so far in html...

<html>

<head>

<style>

*    { font-family: arial; font-size: 12px; }

th    { border: red 3px; background-color: red;  color:  black; font-size: 16px; }

.team { border: red 2px; background-color: white; width: 120px; height: 24px; }

.team2 { border: black 2px; background-color: wheat; width: 120px; height: 24px; }

.team3 { border: black 2px; background-color: pink; width: 120px; height: 24px; }

</style>

<script>

function win(winner)

{

var team = winner.value;

var levels = winner.name.substring(3).split("_");

var curlevel = parseInt(levels[0]);

var curgame = parseInt(levels[1]);

 

var nextlevel = curlevel + 1;

var nextgame = Math.floor( (curgame+1) / 2 );

 

var curteam = winner.form.elements["WIN"+nextlevel+"_"+nextgame].value;

var winnerButton = winner.form.elements["WIN"+nextlevel+"_"+nextgame];

if ( winnerButton == null ) return;

 

++nextlevel;

nextgame = Math.floor( (nextgame+1) / 2 );

var nextButton = winner.form.elements["WIN"+nextlevel+"_"+nextgame];

var forward = ( nextButton != null && nextButton.value == winnerButton.value );

 

winnerButton.value = team;

while ( forward ) {

nextButton.value = " ";

++nextlevel;

nextgame = Math.floor( (nextgame+1) / 2 );

nextButton = winner.form.elements["WIN"+nextlevel+"_"+nextgame];

forward = ( nextButton != null && nextButton.value == curteam );

}

}

</script>

</head>

<body>

<form>

<table border=0 cellpadding=0>

 

<tr>

      <th colspan=4 style="font-size: x-large;">West</th>

     

<tr>

    <td><input type=button class="team" name="WIN0_1" onclick="win(this)" value="#1 Seed"></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_1" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_2" onclick="win(this)" value="#16 Seed"></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN2_1" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_3" onclick="win(this)" value="#8 Seed"></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_2" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_4" onclick="win(this)" value="#9 Seed"></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN3_1" onclick="win(this)" value=""></td>

</tr>

<tr>

       

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_5" onclick="win(this)" value="#4 Seed"></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_3" onclick="win(this)" value=""></td>

 

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_6" onclick="win(this)" value="#13 Seed"></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN2_2" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_7" onclick="win(this)" value="#5 Seed"></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_4" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_8" onclick="win(this)" value="#12 Seed"></td>

</tr>

 

<tr>

       

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_9" onclick="win(this)" value="#3 Seed" ></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_5" onclick="win(this)" value="" ></td>

 

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_10" onclick="win(this)" value="#14 Seed" ></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN2_3" onclick="win(this)" value="" ></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_11" onclick="win(this)" value="#6 Seed" ></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_6" onclick="win(this)" value="" ></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_12" onclick="win(this)" value="#11 Seed" ></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN3_2" onclick="win(this)" value="" ></td>

</tr>

<tr>

       

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_13" onclick="win(this)" value="#2 Seed" ></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_7" onclick="win(this)" value="" ></td>

 

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_14" onclick="win(this)" value="#15 Seed" ></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN2_4" onclick="win(this)" value="" ></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_15" onclick="win(this)" value="#7 Seed" ></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_8" onclick="win(this)" value="" ></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_16" onclick="win(this)" value="#10 Seed" ></td>

</tr>

<tr>

      <th colspan=4 style="font-size: x-large;">Mid West</th>

     

<tr>

    <td><input type=button class="team" name="WIN0_17" onclick="win(this)" value="#1 Seed"></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_9" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_18" onclick="win(this)" value="#16 Seed"></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN2_5" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_19" onclick="win(this)" value="#8 Seed"></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_10" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_20" onclick="win(this)" value="#9 Seed"></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN3_3" onclick="win(this)" value=""></td>

</tr>

<tr>

       

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_21" onclick="win(this)" value="#4 Seed"></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_11" onclick="win(this)" value=""></td>

 

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_22" onclick="win(this)" value="#13 Seed"></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN2_6" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_23" onclick="win(this)" value="#5 Seed"></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_12" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_24" onclick="win(this)" value="#12 Seed"></td>

</tr>

 

<tr>

       

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_25" onclick="win(this)" value="#3 Seed" ></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_13" onclick="win(this)" value="" ></td>

 

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_26" onclick="win(this)" value="#14 Seed" ></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN2_7" onclick="win(this)" value="" ></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_27" onclick="win(this)" value="#6 Seed" ></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_14" onclick="win(this)" value="" ></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_28" onclick="win(this)" value="#11 Seed" ></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN3_4" onclick="win(this)" value="" ></td>

</tr>

<tr>

       

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_29" onclick="win(this)" value="#2 Seed" ></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_15" onclick="win(this)" value="" ></td>

 

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_30" onclick="win(this)" value="#15 Seed" ></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN2_8" onclick="win(this)" value="" ></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_31" onclick="win(this)" value="#7 Seed" ></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_16" onclick="win(this)" value="" ></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_32" onclick="win(this)" value="#10 Seed" ></td>

</tr>

<tr>

      <th colspan=4 style="font-size: x-large;">East</th>

       

<tr>

    <td><input type=button class="team" name="WIN0_33" onclick="win(this)" value="#1 Seed"></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_17" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_34" onclick="win(this)" value="#16 Seed"></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN2_9" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_35" onclick="win(this)" value="#8 Seed"></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_18" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_36" onclick="win(this)" value="#9 Seed"></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN3_5" onclick="win(this)" value=""></td>

</tr>

<tr>

       

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_37" onclick="win(this)" value="#4 Seed"></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_19" onclick="win(this)" value=""></td>

 

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_38" onclick="win(this)" value="#13 Seed"></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN2_10" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_39" onclick="win(this)" value="#5 Seed"></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_20" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_40" onclick="win(this)" value="#12 Seed"></td>

</tr>

 

<tr>

       

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_41" onclick="win(this)" value="#3 Seed" ></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_21" onclick="win(this)" value="" ></td>

 

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_42" onclick="win(this)" value="#14 Seed" ></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN2_11" onclick="win(this)" value="" ></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_43" onclick="win(this)" value="#6 Seed" ></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_22" onclick="win(this)" value="" ></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_44" onclick="win(this)" value="#11 Seed" ></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN3_6" onclick="win(this)" value="" ></td>

</tr>

<tr>

       

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_45" onclick="win(this)" value="#2 Seed" ></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_23" onclick="win(this)" value="" ></td>

 

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_46" onclick="win(this)" value="#15 Seed" ></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN2_12" onclick="win(this)" value="" ></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_47" onclick="win(this)" value="#7 Seed" ></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_24" onclick="win(this)" value="" ></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_48" onclick="win(this)" value="#10 Seed" ></td>

</tr>

<tr>

      <th colspan=4 style="font-size: x-large;">South</th>

       

<tr>

    <td><input type=button class="team" name="WIN0_49" onclick="win(this)" value="#1 Seed"></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_25" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_50" onclick="win(this)" value="#16 Seed"></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN2_13" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_51" onclick="win(this)" value="#8 Seed"></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_26" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_52" onclick="win(this)" value="#9 Seed"></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN3_7" onclick="win(this)" value=""></td>

</tr>

<tr>

       

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_53" onclick="win(this)" value="#4 Seed"></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_27" onclick="win(this)" value=""></td>

 

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_54" onclick="win(this)" value="#13 Seed"></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN2_14" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_55" onclick="win(this)" value="#5 Seed"></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_28" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_56" onclick="win(this)" value="#12 Seed"></td>

</tr>

 

<tr>

       

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_57" onclick="win(this)" value="#3 Seed" ></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_29" onclick="win(this)" value="" ></td>

 

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_58" onclick="win(this)" value="#14 Seed" ></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN2_15" onclick="win(this)" value="" ></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_59" onclick="win(this)" value="#6 Seed" ></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_30" onclick="win(this)" value="" ></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_60" onclick="win(this)" value="#11 Seed" ></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN3_8" onclick="win(this)" value="" ></td>

</tr>

<tr>

       

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_61" onclick="win(this)" value="#2 Seed" ></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_31" onclick="win(this)" value="" ></td>

 

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_62" onclick="win(this)" value="#15 Seed" ></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td><input type=button class="team2" name="WIN2_16" onclick="win(this)" value="" ></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_63" onclick="win(this)" value="#7 Seed" ></td>

</tr>

<tr>

    <td></td>

    <td><input type=button class="team" name="WIN1_32" onclick="win(this)" value="" ></td>

</tr>

<tr>

    <td><input type=button class="team" name="WIN0_64" onclick="win(this)" value="#10 Seed" ></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td> </td>

    <td> </td>     

        <th colspan=3 style="font-size: x-large;">Final Four</th>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td> </td>

    <td> </td>

    <td><input type=button class="team3" name="WIN4_1" onclick="win(this)" value=""></td>

</tr>

<tr>

 

    <td></td>

    <td></td>

    <td></td>

    <td></td>

    <td></td>

    <td><input type=button class="team3" name="WIN5_1" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td> </td>

    <td> </td>

    <td><input type=button class="team3" name="WIN4_2" onclick="win(this)" value=""></td>

</tr>

 

 

<tr>

    <td></td>

    <td></td>

    <td></td>

    <td></td>

    <td colspan=2 style="font-size: 20px;  color:  red; text-align: right;">CHAMPION:  </td>

    <td><input type=button class="team"

              style="width: 160px; font-size: 20px; background-color: orange; height: 32px;"

              name="WIN6_1" onclick="win(this)" value=""></td>

</tr>

 

<tr>

    <td> </td>

    <td> </td>

    <td> </td>

    <td> </td>

    <td><input type=button class="team3" name="WIN4_3" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td></td>

    <td></td>

    <td></td>

    <td></td>

    <td></td>

    <td><input type=button class="team3" name="WIN5_2" onclick="win(this)" value=""></td>

</tr>

<tr>

    <td> </td>

    <td> </td>

    <td> </td>

    <td> </td>

    <td><input type=button class="team3" name="WIN4_4" onclick="win(this)" value=""></td>

</tr>

 

</table>

</form>

</body>

 

 

Please any help would be greatly appreciated!  I dont understand how to get this working in php!!!

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/184526-ncaa-march-madness-bracket-help/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.