时间:2021-07-01 10:21:17 帮助过:10人阅读
;
var xmlHttp;
function S_xmlhttprequest() {
if(window.ActiveXObject) {
xmlHttp = new ActiveXObject('Microsoft.XMLHTTP');
} else if(window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}
function funphp100(name) {
var f=document.myform.user.value;
S_xmlhttprequest();
xmlHttp.open("GET","for.php?id="+f,true);
xmlHttp.onreadystatechange = byphp;
xmlHttp.send(null);
}
function byphp() {
if(xmlHttp.readyState == 1) {
document.getElementById('php100').innerHTML = "";
}
if(xmlHttp.readyState == 4 ){
if(xmlHttp.status == 200) {
var byphp100 = xmlHttp.responseText;
document.getElementById('php100').innerHTML = byphp100;
}
}
}
if(@$_GET[id]){
sleep(1);
$conn=mysql_connect('localhost','root','');
mysql_select_db('test',$conn);
echo $sql="SELECT * FROM `user` where `user`='$_GET[id]'";
$q=mysql_query($sql);
if(is_array(mysql_fetch_row($q))){
echo "用户名已经存在";
}else
{
echo "可以使用";
}
}
?>
show variables like 'char%'