I'm confused by what I left off....
Code: Select all
<?php
/* Let's get the data from the entry form */
$contact=strip_tags(trim($_POST['username']));
$emailonform=strip_tags(trim($_POST['emailaddress']));
$commentsonform=strip_tags(trim($_POST['comments']));
$cityonform=strip_tags(trim($_POST['city']));
$scoreofgame=strip_tags(trim($_POST['finalscore']));
$poinsetta=$_POST['bowlgame1'];
$pioneer=$_POST['bowlgame2'];
$neworleans=$_POST['bowlgame3'];
$birmingham=$_POST['bowlgame4'];
$newmexico=$_POST['bowlgame5'];
$ftworth=$_POST['bowlgame6'];
$honolulu=$_POST['bowlgame7'];
$detroit=$_POST['bowlgame8'];
$sanfrancisco=$_POST['bowlgame9'];
$shreveport=$_POST['bowlgame10'];
$sandiego=$_POST['bowlgame11'];
$houston=$_POST['bowlgame12'];
$nashville=$_POST['bowlgame13'];
$elpaso=$_POST['bowlgame14'];
$memphis=$_POST['bowlgame15'];
$tempe=$_POST['bowlgame16'];
$orlando=$_POST['bowlgame17'];
$charlotte=$_POST['bowlgame18'];
$sanantonio=$_POST['bowlgame19'];
$atlanta=$_POST['bowlgame20'];
$boise=$_POST['bowlgame21'];
$tampa=$_POST['bowlgame22'];
$dallas=$_POST['bowlgame23'];
$jacksonville=$_POST['bowlgame24'];
$orlando=$_POST['bowlgame25'];
$pasadena=$_POST['bowlgame26'];
$glendale=$_POST['bowlgame27'];
$miami=$_POST['bowlgame28'];
$neworleans2=$_POST['bowlgame29'];
$toronto=$_POST['bowlgame30'];
$mobile=$_POST['bowlgame31'];
$glendale2=$_POST['bowlgame32'];
/* Open Database Insert Data Into Table */
$host="localhost";
$user="username is here";
$password="password is here" ;
$connection = mysql_connect($host,$user,$password)
or die("Couldn't Make the Connection");
$database="worso3_football";
$db = mysql_select_db($database,$connection)
or die("Couldn't Select Database");
$query = "INSERT INTO footballgames(username,emailaddress,city,comments,
game1,game2,game3,game4,game5,game6,game7,game8,game9,game10,game11,
game12,game13,game14,game15,game16,game17,game18,game19,game20,game21,game22, game23,game24,game25,game26,game27,game28,game29,game30,game31,game32,bcsfinalscore)
VALUES ('$contact','$emailonform','$cityonform','$commentsonform',
'$poinsetta','$pioneer','$neworleans','$birmingham','$newmexico','$ftworth',
'$honolulu','$detroit','$sanfrancisco','$shreveport','$sandiego','$houston',
'$nashville','$elpaso','$memphis','$tempe','$orlando','$charlotte','$sanantonio',
'$atlanta','$boise','$tampa','$dallas','$jacksonville','$orlando','$pasadena','$glendale',
'$miami','$neworleans2','$toronto','$mobile','$glendale2','$scoreofgame')";
/*How'd we do? */
$result = mysql_query($query)
or die ("Couldn't Execute Query.");
echo "Your Selections Have Been Recorded<br>";
$email = "texbowls@yahoo.com";
$headers ="From: hank@worsoftware.com\nBCC: hank@worsoftware.com";
$subject = "Another Player Enters";
$msg1="$contact";
$msg2="$emailonform";
$msg3="$cityonform";
$message = "$msg1"."\n"."$msg2"."\n"."$msg3";
mail($email, $subject, $message, $headers);
$animaltype="Selections";
echo "<h1 align='center'>$animaltype</h1>";
echo "<table border='1>";
echo "<tr>\n
<td align='center'>$contact</td>
<td align='center'>$emailonform</td>
<td align='center'>$cityonform</td>
</tr>";
echo "<tr>\n
<td align='right'>Poinsetta</td>
<td align='center'>$poinsetta</td>
</tr>";
echo "<tr>\n
<td align='right'>Pioneer</td>
<td align='center'>$pioneer</td>
</tr>";
echo "<tr>\n
<td align='right'>New Orleans</td>
<td align='center'>$neworleans</td>
</tr>";
echo "<tr>\n
<td align='right'>Birmingham</td>
<td align='center'>$birmingham</td>
</tr>";
echo "<tr>\n
<td align='right'>New Mexico</td>
<td align='center'>$newmexico</td>
</tr>";
echo "<tr>\n
<td align='right'>Ft. Worth</td>
<td align='center'>$ftworth</td>
</tr>";
echo "<tr>\n
<td align='right'>Honolulu</td>
<td align='center''>$honolulu</td>
</tr>";
echo "<tr>\n
<td align='right'>Detroit</td>
<td align='center'>$detroit</td>
</tr>";
echo "<tr>\n
<td align='right'>San Francisco</td>
<td align='center'>$sanfrancisco</td>
</tr>";
echo "<tr>\n
<td align='right'>Shreveport</td>
<td align='center'>$shreveport</td>
</tr>";
echo "<tr>\n
<td align='right'>San Diego</td>
<td align='center'>$sandiego</td>
</tr>";
echo "<tr>\n
<td align='right'>Houston</td>
<td align='center'>$houston</td>
</tr>";
echo "<tr>\n
<td align='right'>Nashville</td>
<td align='center'>$nashville</td>
</tr>";
echo "<tr>\n
<td align='right'>El Paso</td>
<td align='center'>$elpaso</td>
</tr>";
echo "<tr>\n
<td align='right'>Memphis</td>
<td align='center'>$memphis</td>
</tr>";
echo "<tr>\n
<td align='right'>Tempe</td>
<td align='center'>$tempe</td>
</tr>";
echo "<tr>\n
<td align='right'>Orlando</td>
<td align='center'>$orlando</td>
</tr>";
echo "<tr>\n
<td align='right'>Charlotte</td>
<td align='center'>$charlotte</td>
</tr>";
echo "<tr>\n
<td align='right'>San Antonio</td>
<td align='center'>$sanantonio</td>
</tr>";
echo "<tr>\n
<td align='right'>Atlanta</td>
<td align='center'>$atlanta</td>
</tr>";
echo "<tr>\n
<td align='right'>Boise</td>
<td align='center'>$boise</td>
</tr>";
echo "<tr>\n
<td align='right'>Tampa</td>
<td align='center'>$tampa</td>
</tr>";
echo "<tr>\n
<td align='right'>Dallas</td>
<td align='center'>$dallas</td>
</tr>";
echo "<tr>\n
<td align='right'>Jacksonville</td>
<td align='center'>$jacksonville</td>
</tr>";
echo "<tr>\n
<td align='right'>Orlando</td>
<td align='center'>$orlando</td>
</tr>";
echo "<tr>\n
<td align='right'>Pasadena</td>
<td align='center'>$pasadena</td>
</tr>";
echo "<tr>\n
<td align='right'>Glendale</td>
<td align='center'>$glendale</td>
</tr>";
echo "<tr>\n
<td align='right'>Miami</td>
<td align='center'>$miami</td>
</tr>";
echo "<tr>\n
<td align='right'>Sugar</td>
<td align='center'>$neworleans2</td>
</tr>";
echo "<tr>\n
<td align='right'>International</td>
<td align='center'>$toronto</td>
</tr>";
echo "<tr>\n
<td align='right'>Mobile</td>
<td align='center'>$mobile</td>
</tr>";
echo "<tr>\n
<td align='right'>Championship</td>
<td align='center'>$glendale2</td>
<td align='right'>Predicted Score</td>
<td align='center'>$scoreofgame</td>
</tr>";
echo "</table>\n";
?>