<?php
error_reporting(0);
header("Content-type: text/html; charset=utf-8");
$ip = $_POST['mysqlip'];
$username = $_POST['mysqlusername'];
$userpass = $_POST['mysqluserpass'];
$db = $_POST['mysqldb'];
$ok1 = mysql_connect($ip,$username,$userpass)or die("数据库连接错误,请检查账号或密码是否有误!");
$ok2 = mysql_select_db($db)or die("无法找到数据库,请检查数据库名称是否填写正确");
if($ok1 or $ok2){
    echo "ok";
}
?>