<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<?php 

	
echo 	$arr = explode(',',$_POST['technology_id']);

	foreach ($arr as $key => $value)
	{
		echo $value;
		echo '<br>';
	}
?>
<script>
	function select_tech()
	{
		var frm = document.frm;
		var id = '';
		for(i=0;i<frm.technology.length;i++)
		{
			if(frm.technology[i].selected)
			{
				
				if(id != '')
					id += ','+frm.technology[i].value;
				else
					id = frm.technology[i].value;
			}
		}
		frm.technology_id.value = id;
	}
</script>
<form name="frm" method="post">
	<select name="technology" multiple="multiple">
    	<option value="1">PHP</option>
        <option value="2">ASP.NET</option>
        <option value="3">Iphone</option>
        <option value="4">Flash</option>
        <option value="5">Java</option>
    
    </select>
    <input type="submit" name="submit" value="Submit" onclick="select_tech()"/>
<input type="hidden" name="technology_id" value="" />
</form>
</body>
</html>