option block

From: Date: Wed, 10 Oct 2001 19:16:16 +0000
Subject: option block
Groups: php.general 
Request: Send a blank email to php-general+get-70726@lists.php.net to get a copy of this message
Well hello again and thank you for that last solution..... Unfortunatly for me, I have another one. My option block is not working. My variable $team holds the string of the last possible option instead of the one chosen by the user....Can someone please help me... ---------------- <? session_start(); session_register("PHP_AUTH_USER"); echo $accounts; echo $PHP_AUTH_USER; $team = ""; $db_name = "hpool"; $table_name = "teams"; $connection = @mysql_connect("l", "h", "c") or die("Couldn't connect."); $db = @mysql_select_db($db_name, $connection) or die("Couldn't select database."); $sql = "SELECT selection.team FROM selection Where selection.username = '$PHP_AUTH_USER' and selection.setting = 'on' and selection.accounts = '$accounts' "; $result = @mysql_query($sql,$connection) or die("Couldn't execute query."); while ($row = mysql_fetch_array($result)) { $team = $row['team']; $option_block .= "<option value=\"$team\">$team</option>"; } $display_block = " echo $team <FORM METHOD=\"post\" ACTION=\"show_makeapick.php\"> <INPUT TYPE=hidden name=accounts value=$accounts> <P><strong>Team:</strong> <select name=\"team\"> $option_block </select> <INPUT TYPE=\"SUBMIT\" NAME=\"submit\" VALUE=\"Select this Team\"></P> </form> "; ?> <HTML> <HEAD> <TITLE>Make a Pick</TITLE> </HEAD> <body background="jam-back.gif"></body> <h1>Make a Pick</h1> <P>Select a team from the list below, to select your weekly pick.</p> <? echo "$display_block"; ?> <p><a href="contact_menu3.php" onmouseover="window.status='Return to Main Menu';return true;" target="">Return to Main Menu</a></p> </BODY> </HTML>

« previous php.general (#70726) next »