<?php
if($post=='true'){
$array = @explode("<zalvsa>",$string);
for($i=0;$i<count($array);$i++){
    echo $array[$i]."<br/>";
    //增加到数据库的操作
}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
<!--
function addSrcToDestList() {
destList = window.document.forms[0].destList;
srcList = window.document.forms[0].srcList;
var len = destList.length;
for(var i = 0; i < srcList.length; i++) {
if ((srcList.options[i] != null) && (srcList.options[i].selected)) {var found = false;
for(var count = 0; count < len; count++) {
if (destList.options[count] != null) {
if (srcList.options[i].text == destList.options[count].text) {
found = true;
break;
      }
   }
}
if (found != true) {
destList.options[len] = new Option(srcList.options[i].text);
len++;
         }
      }
   }
}function deleteFromDestList() {
var destList  = window.document.forms[0].destList;
var len = destList.options.length;
for(var i = (len-1); i >= 0; i--) {
if ((destList.options[i] != null) && (destList.options[i].selected == true)) {
destList.options[i] = null;
      }
   }
}function show_value(){
var i = document.forms[0].destList.options.length;
var string = '';
for(j=0;j<i;j++){
   string +=document.forms[0].destList.options[j].text+'<zalvsa>';
}
window.location.href="16.php?string="+string+"&post=true";
}
// -->
</SCRIPT>
</head>
<body>
<center>
<form method="POST">
<table bgcolor="#FFFFCC"><tr>
<td bgcolor="#FFFFCC" width="85">
<select size="6" name="srcList" multiple>
<option value="Item1">Item 1
<option value="Item 2">Item 2
<option value="Item 3">Item 3
<option value="Item 4">Item 4
<option value="Item 5">Item 5
<option value="Item 6">Item 6
</select>
</td>
<td bgcolor="#FFFFCC" width="74" align="center">
<input type="button" value=" 增加到右边 " onClick="javascript:addSrcToDestList()">
<br/><br/>
<input type="button" value=" 从右边删除 " onclick="javascript:deleteFromDestList();">
</td>
<td bgcolor="#FFFFCC" width="69">
<select size="6" name="destList" multiple>
</select>
</td>
<td><input type='button' value='click me' onclick='show_value()'>
</tr>
</table>
</form>
</body>
</html>