<table>
<tr>
<td>会员编号:</td>
<td><input type="text" name="uid" value="" id="uid" onchange="che()" >* 非会员请填0</td>
</tr>
<tr>
<td>用户名:</td>
<td><input type="text" disabled value="" id="username" ></td>
</tr>
</table>
------------------
<script>
function che() {
var userid = $("#uid").val();
$.post("us.php",{userid: userid},
function(data){
$("#username").val (data);
document.getElementById("sub").innerHTML = "<input type='submit' value='确定会员'>";
})
};
</script>
-------------------
<?php
include('connn.php');
$userid = $_POST['userid'];
if ($userid==0){
echo "非用户";
}
$resultvb=mysql_fetch_assoc(mysql_query("select user_name from user where user_id='$userid'"));
if ($resultvb['user_name']){
echo $resultvb['user_name'];
}else{
echo "无此用户";
}
?>