Jump to content

echo (get) data from combo box ?


ebchost

Recommended Posts

I try somthing like this, but i have problem

<?php
$path = $_SERVER['DOCUMENT_ROOT'];
$path .= "/resources/init.php";
include_once($path); 

$formacije = "SELECT * FROM `man_formacije` ORDER BY `id` ASC";
$rezultati = mysql_query($formacije) or die (mysql_error());
$dropdown = "<select name='formacija'>";
?>
<select>
<?php
while($row = mysql_fetch_array($rezultati))
{
	$id = $row['id'];
	$naziv = $row['naziv'];
	$meta = $_GET['id'];
	?>
		<option value="<?php echo $id; ?>"><?php echo $naziv; ?></option>
	<?php		
}
?>	
</select>
<?php


if($meta)
{
	echo "<br> $id";
}
else
echo "error";
?>

 

I have error message, or if i put ($meta = $_GET['id'];) part of code, below select (combo box) i have echo 20

 

how to echo (or get) corect value of selctet data from combo box ?

Link to comment
https://forums.phpfreaks.com/topic/254163-echo-get-data-from-combo-box/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.