52,797
社区成员
发帖
与我相关
我的任务
分享
<div id="obtobt">
<select id="obt" name="obt">
<!-- 说话对象 -->
<?php
foreach($_SESSION["per"] as $value){
echo '<option value="'.$value.'">'.$value.'</option>';
}
?>
</select>
</div>
foreach($arr as $key => $value){
$tmparr = explode(',',$value);
$tmp .= '<img id="head'.$key.'" src="images/'.($tmparr[1]==1?'boy.gif':'girl.gif').'" border="0" width="25" height="26" /> ';
$tmp .= '<a onclick=changename("'.$tmparr[0].'")style="cursor:pointer;">'.$tmparr[0].'</a><br>';
}
function changename(name){
url = "talk_chk.php?action=to&name="+name;
var select = document.getElementById('obtobt');
xmlhttp.open('GET',url,true);
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readyState ==4){
var msg=xmlhttp.responseText;
select.innerHTML = msg;
}
}
xmlhttp.send(null);
}
url = "talk_chk.php?action=to&name="+name+'&_dc='+new Date().getTime();
if(xmlhttp.readyState==4){
if(xmlhttp.status==200){
var msg=xmlhttp.responseText;
select.innerHTML = msg;
}
}