combobox echo

Hi i’m trying to make the value chosen in combobox be write whit echo after i hit submit but i can’t make it here is the code I have [php]





<?php $con = mysql_connect("localhost", "root", ""); if (!$con) die('Could not connect: ' . mysql_error()); mysql_select_db("try", $con); $sql = "SELECT * FROM incerc"; $result = mysql_query($sql,$con); echo "----Alegeti nume----\n"; while($row = mysql_fetch_array($result)) { echo "".$row['nume']."\n"; } echo ""; if(isset($_POST['submit'])) { echo combobox value; } mysql_close($con); ?>
  <form action="">
[/php]

Try to code below and notice I made a change to line 15 and 25, you’re also using a bunch of obsolete SQL functions, that should be converted to PDO.

[php]





<?php $con = mysql_connect("localhost", "root", ""); if (!$con) die('Could not connect: ' . mysql_error()); mysql_select_db("try", $con); $sql = "SELECT * FROM incerc"; $result = mysql_query($sql,$con); echo "----Alegeti nume----\n"; while($row = mysql_fetch_array($result)) { echo "".$row['nume']."\n"; } echo ""; if(isset($_POST['submit'])) { echo $_POST['mycombobox']; } mysql_close($con); ?>
   <form action="">
[/php]
Sponsor our Newsletter | Privacy Policy | Terms of Service