html - PHP dropdown not sending through POST -


I have a drop-down that is created by a PHP function that is pulling from MySQL tables. Drop docs work fine but the selected options are not posting. I suspect that with the problem that the HTML selection tag has been created in PHP, but I can not find any way to fix it.

  function contact_list () {// connection information $ dbhost}   

= 'localhost'; $ Db = 'database'; $ Dbuser = 'User'; $ Dbpass = 'Password'; // Define Connection $ con = mysqli_connect ($ dbhost, $ dbuser, $ dbpass, $ db); // Check connection if (mysqli_connect_errno ()) {echo "error" Mysqli_connect_error () "error"; } // Determine the search string for the drop down contact_list = "SELECT * FROM CONTACT_LIST"; // primary_contact Search the table if (! Mysqli_query ($ con, $ contact_list)) (die ('. Mysqli_error ($ con));} Return Return to primary_contact results string $ contact_result = $ con- & gt; Loop result ($ contact_result $ as row) via query ($ contact_list) as // drop down echo "Select name = 'primitive contact' & gt;"; // result {echo " & Lt; option value = '' & gt; ".htmlspecialchars ($ line ['Primary_Contact'])." & Lt; / option & gt; ";} resonant" & lt; / select & gt; & lt; p & Gt; & lt; / p & gt; ";}

Here's a humid HTML The description text box is OK so I do not think the problem is with the tag.

  form action = "mod_output_test.php" method = "POST" & gt; & lt; U & gt; Details & lt; / u & gt ;: & lt; p & gt; & lt; / p & gt; Input type = "text" name = "description" size = "48" value = " & gt; & gt; & lt; p & gt; & lt; / p & gt; & lt;! - Primary contact - & gt; & lt ;? php echo" & Lt; U & gt; Primary contact & lt; / U & gt;: & lt; P & gt; & Lt; / P & gt; Current value: & amp; Nbsp; & Lt; B & gt; "$ Primary_Contact" & lt; / B & gt; & Nbsp; New value: ";?" Gt; php contact_list ()? & Gt; & lt; p & gt; & lt; / p & gt; & lt; input type = "submit" & gt; Lt; / Forms & gt;  

Change

  Echo option option & lt; option value = '' & gt; .htmlspecialchars ($ line ['Primary_Contact']). "& Lt; / option & gt;";  

to

  echo "option option = '". $ Line ['id']. ' '& Gt; ".htmlspecialchars ($ line ['Primary_Contact'])." & Lt; / Option & gt; ";  

And I'm guessing my dropdown, a form is between the tags.

At the top of the action file type and let us know What do you get

  & lt ;? php print_r ($ _ request); go out;? & Gt;  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -