hey there, i have a form with 2 hidden fields... i can only ever access one of the fields after i hit the form button .... is there a maximum number of hidden fields your allowed to have per form?

here is the code:

echo "<form method='post' action='search_results.php'>";
		// set redirect flag to yes, so that the search_results doesnt mine for players again, but rather just uses
		// the player name passed through this form 
		echo "<input type='hidden' name='redirect' value='yes'>";
		echo "<input type='hidden' name='year' value='$season'>";
		for($i = 0; $i <= $array_count; $i++)
		{
			// display array element as long as its not empty
			if ($reduced_names[$i] != "")
			{
				$player_name = $reduced_names[$i];
				echo "<tr><td><div align='center'><input type='radio' name='criteria' width='25%' value='$player_name'>
					$player_name</div></td></tr>";
			}
		}
		echo "<tr><td><div align='center'><input type='submit' name='select' value='Select player'></div></td></tr>";

    No limit on hidden fields so probably your source is wrong: ie no value set for $season

      Roger Ramjet wrote:

      No limit on hidden fields so probably your source is wrong: ie no value set for $season

      thats what i thought at first.... but when i put a print $season; command into the form (as in the modified code below), the correct "20062007" gets displayed.... so the the $season variable has the correct information in it, but this information isnt getting passed through for some reason

      echo "<form method='post' action='search_results.php'>"; 
              // set redirect flag to yes, so that the search_results doesnt mine for players again, but rather just uses 
              // the player name passed through this form 
              print $season;
              echo "<input type='hidden' name='redirect' value='yes'>"; 
              echo "<input type='hidden' name='year' value='$season'>"; 
              for($i = 0; $i <= $array_count; $i++) 
              { 
                  // display array element as long as its not empty 
                  if ($reduced_names[$i] != "") 
                  { 
                      $player_name = $reduced_names[$i]; 
                      echo "<tr><td><div align='center'><input type='radio' name='criteria' width='25%' value='$player_name'> 
                          $player_name</div></td></tr>"; 
                  } 
              } 
              echo "<tr><td><div align='center'><input type='submit' name='select' value='Select player'></div></td></tr>"; 

        Most likely would be some simple typo in the form processing code which is not correctly referencing the $_POST['season'] value correctly, or perhaps overwriting it by using a "=" in a comparison statement instead of "==".

          Have you looked at the html source in the browser? What values are in those hidden fields? Forget what is in the php, always look at the output actually received by the browser.

            After examining the outputted HTML, you might try doing a print_r($_POST); in PHP to see what all is being POSTed.

              Write a Reply...