My code is below.
<?php
include ('db.php');
ob_start(); ?>
<HTML><HEAD>
<BODY bgcolor="#0000CC" text="#0000CC">
<p> </p><div align="center">
<table width="640" border="4" align="center" height="480" bordercolor="#FFFF33" bgcolor="#CCCCCC" tracingsrc="secpinwh.gif" tracingopacity="33">
<tr align="center" valign="middle">
<td>
<table border="0" width="274" align="center">
<tr>
<td>
<div align="center"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="http://www.secpicks.com/signup.php" style="text-decoration:none">SIGNUP</a></font></div>
</td>
<td>
<div align="center"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="http://www.secpicks.com/login.php" style="text-decoration:none">LOGIN</a></font></div>
</td>
<td>
<div align="center"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="http://www.secpicks.com/logout.php" style="text-decoration:none">LOGOUT</a></font></div>
</td>
<td>
<div align="center"><font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="http://www.secpicks.com/users.php" style="text-decoration:none">MY
PICKS</a></font></div>
</td>
</tr>
</table>
<p align="center"><font size="+3">SEC PICKS</font></p>
<div align="center">
<p align="center"> </p>
<p align="center"><font size="3" face="Verdana, Arial, Helvetica, sans-serif"><?php ob_end_flush(); ?><?php
$linkl = mysql_connect("localhost", "xx", "xxx");
mysql_select_db("xxx", $linkl) or die ('Can\'t use foo : ' . mysql_error());
$resultl = mysql_query("SELECT username FROM users order by username")
or die("Invalid query: " . mysql_error());
$resultlx = mysql_query("SELECT team, tpass FROM teams order by team")
or die("Invalid query: " . mysql_error());
echo"
Please Sign Up!<br>
<form action=\"teamup.php?action=add\" method=\"post\">
Select Username: <br>
";
print "<select name=username1>";
while ($row = mysql_fetch_assoc($resultl)){
$username1=$row["username"];
print "<option value=$username1>$username1</option>";
}
print "</select>";
print "<br>";
echo"
Select Team: <br>
";
print "<select name=team1>";
while ($row = mysql_fetch_assoc($resultlx)){
$team1=$row["team"];
print "<option value=$team1>$team1</option>";
}
print "</select>";
print "<br>";
echo"
Enter Password: <input type=\"password\" name=\"password\" size=\"20\"><br>
<input type=\"submit\" value=\"submit\" name=\"submit\">
</form> ";
ob_end_flush();
if ($action == add)
{
$conn = mysql_connect("localhost","$db_user","$db_pass");
$db = mysql_select_db("$db_name");
$exists=0;
$result2 = mysql_query("SELECT username from users");
while ($row = mysql_fetch_assoc($result2)){
foreach ($row as $col=>$val){
if (strlen($POST['username1'])==0 or strlen($POST['password'])==0 or strlen($_POST['team1'])==0)
{
$exists=1;
}
}
}
if ($exists==0)
{
$result= MYSQL_QUERY("INSERT INTO teamsd (username, team)". "VALUES ('$username1', '$team1')");
print "<p>Your username: $username1 and team: $team1 have been submitted.</p>";
print "<p>You may now <a href=http://www.secpicks.com/login.php>LOGIN</a> and make you picks!</p>";
}
else{
print "<p>Username is already taken or invalid username/password.</p>";
print "<p>Please try again.</p>";
}
}
else{
echo " ";
}
?></font><br>
</p>
</div>
<div align="center"></div>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"><font size="2">Questions: <a href="mailto:bart@secpicks.com">bart@secpicks.com</a></font></p>
</td>
</tr>
</table>
<p> </p>
</div>
</BODY></HTML>